Category Archives: Uncategorized

How to do JSON Parsing in Android?

JSON stands for JavaScript Object Notation.It is an independent data exchange format and is the best alternative for XML. All the responses from server are json encoded (if encoded i n PHP file). In order to parse them, following are … Continue reading

Posted in Uncategorized | Leave a comment

How to Communicate With Web Server in Android?

In order to store the data filled by an android application user on the Web Server, you have to  follow the following steps: Declare Internet permissions in the manifest by adding the following line to AndroidManifest.xml. <uses-permission android:name=”android.permission.INTERNET”/> Create your … Continue reading

Posted in Uncategorized | 2 Comments

How to delete SQLite Database from adb command line of Android?

1) Change to directory, platform-tools. In my case, its cd Music/adt-bundle-linux-x86-20140321/sdk/platform-tools/ List all items in it. ls It will show you adb executable file also.Give the following command. adb shell Your command prompt will change to root@generic:/ # Change to … Continue reading

Posted in Uncategorized | Leave a comment

How to create simple (unbound) Service in Android?

  Services in Android System 1) Faceless components: A service is a component which runs in the background without direct interaction with the user. As the service has no user interface, it is not bound to the lifecycle of an … Continue reading

Posted in Uncategorized | Leave a comment

How to create Notifications in Android?

Notifications: A notification is a message you can display to the user outside of your application’s normal UI. When you tell the system to issue a notification, it first appears as an icon in the notification area. To see the … Continue reading

Posted in Uncategorized | Leave a comment

How to use AsyncTask in Android?

Android implements single thread model and whenever an android application is launched, a thread is created. Assuming we are doing network operation on a button click in our application. On button click a request would be made to the server and … Continue reading

Posted in Uncategorized | Leave a comment

How to pass data from one activity to another in Android?

Lets suppose you have one EditText and one button in one activity and one text view in another activity. On clicking the button, text in Edit Text of activity one should become lable/ text of text view in another activity. … Continue reading

Posted in Uncategorized | Leave a comment

How to connect two activities in Android?

Define onClick attribute of button with function to be called as value of the attribute. <Button …. android:onClick = login />  where login is the name of function that is called when button is clicked.  Now define Intent object inside … Continue reading

Posted in Uncategorized | Leave a comment

How to use Auto Complete Edit Text in Android?

Get the object of AutoCompleteTextView. AutoCompleteTextView mAutoView = (AutoCompleteTextView)findViewById(R.id.autoCompleteTextView1); Create array of ArrayAdapter. ArrayAdapter<String> myAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1 ,new String[] {“delhi”,”delhi2″,”bangalore”,”mumbai”,”pune”});  Set the adapter of AutoCompleteTextView.          mAutoView.setAdapter(myAdapter); And you are done!

Posted in Uncategorized | Leave a comment

Hello World Program in Java

To write a simple program in Java that prints “Hello World” on console, follow the following steps: Make a public class named Application. Define a main function in it. public static void main(String args[]) { } Make sure method signature … Continue reading

Posted in Uncategorized | Leave a comment