Monday, 17 June 2013

Blackberry: Custom Popup Screen[Forgot Password Example]

Here I am providing one example that shows how we customize our Popup Screen. We can use this like a popup Screen or Dialog Screen. 
Below link is the Example for the Custom Popup Screen and I am showing an example of Forgot Password. 

In this you will get again two custom classes. Like, PictureBackgroundButtonField and CustomTextField where we can use images directly to the buttons and text fields. 
It will look like the below image:

Lets try this one. 
Feel free to ask questions.

Tuesday, 11 June 2013

Blackberry: Post Data Using JSON Object

We can post the data by the JSON format. 
For this first,
1. We have to take all the keys and values in One Hash table or Array of Hash tables(Vector)
2. Convert it into JSON object.
3. Send to server.
public class PostDataThread extendsThread
    privateHttpConnection httpConnection;
    privateInputStream inputStream;
    privateStringBuffer stringBuffer=newStringBuffer();
    privateHashtable hashTable;
    privateString URL="";
    public PostDataThread(String url, Hashtable hash,intindex) 
//      System.out.println("=========WEB SERVICE===========: "+url);        
        URL=Utility.escapeHTML(url)+CommonMethods.updateConnectionSuffix();//interface=wifi; or deviceside=false;
        this.hashTable=hash;//Here I am taking one Hashtable. You can manage according to your requirement.
            URLEncodedPostData oPostData =newURLEncodedPostData(URLEncodedPostData.DEFAULT_CHARSET, false);
            byte[] postBytes = oPostData.getBytes();
            httpConnection.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_TYPE,"application / requestJson");
            httpConnection.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_LENGTH, Integer.toString(postBytes.length));
            OutputStream strmOut = httpConnection.openOutputStream();
                inputStream = httpConnection.openInputStream();
                parserInterface.didFailParser("Connection failure HTTP Response: "+response);
        catch(finalException e) 
            String msg=e.getMessage();
                msg="No Data Found";
            //Show failure alert here
            catch(Exception e2) 
    private String provideJSONObject()
            JSONObject jsonObj=newJSONObject();
            jsonObj.put("data", hashTable);//Getting correct data; You can check here
//          System.out.println("======================JSON STRING FOR POSTING: "+jsonObj.toString());
        catch(Exception e) 
    private void parseData(String responseString) 
        //Do what you want.        
and the method for Utility.escapeHTML(url) is:

public static String escapeHTML(String s)
               StringBuffer sb = new StringBuffer();
               int n = s.length();
               for (int i = 0; i < n; i++) {
                     char c = s.charAt(i);
                      switch (c) {
                                           case ‘ ‘: sb.append(“%20″); break;
                                         default: sb.append(c); break;
            return sb.toString();
You can get this class by this below link:

Sunday, 9 June 2013

Blackberry: Video Recording in Blackberry

For video recording first we have to check the memory available in Blackberry. According to that we have to go to the next step.
Download the zip file for the example for Video recording in Blackberry

Monday, 3 June 2013

Create Route on Map in IOS 6

We can easily create Routes between two places.
Here we have 6 main methods:
-(NSArray*)getRoutePointFrom:(CLLocationCoordinate2D)origin to:(CLLocationCoordinate2D)destination
-(NSMutableArray *)decodePolyLine:(NSMutableString *)encodedString
- (MKOverlayView*)mapView:(MKMapView*)theMapView viewForOverlay:(id <MKOverlay>)overlay

Take the code from below link: