Archive

Archive for September, 2011

POST JSON from Android using HttpClient

September 30, 2011 Leave a comment

To POST in Android. You can use something like this code.

public static String makeRequest(String path, Map params)throws Exception
{
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpPost httpost = new HttpPost(path);
Iterator iter = params.entrySet().iterator();
JSONObject holder = new JSONObject();
while(iter.hasNext())
{
Map.Entry pairs = (Map.Entry)iter.next();
String key = (String)pairs.getKey();
Map m = (Map)pairs.getValue(); J
SONObject data = new JSONObject();
Iterator iter2 = m.entrySet().iterator();
while(iter2.hasNext())
{
Map.Entry pairs2 = (Map.Entry)iter2.next();
data.put((String)pairs2.getKey(), (String)pairs2.getValue());
}
holder.put(key, data);
}
StringEntity se = new StringEntity(holder.toString());
httpost.setEntity(se);
httpost.setHeader("Accept", "application/json");
httpost.setHeader("Content-type", "application/json");
ResponseHandler responseHandler = new BasicResponseHandler();
response = httpclient.execute(httpost, responseHandler);
}

Categories: Uncategorized

How to configure Android in Eclipse

September 14, 2011 Leave a comment

1. Download SDK (http://developer.android.com/sdk/index.html)
2. Download AVD (http://developer.android.com/sdk/eclipse-adt.html)
3. Click on Help-> Install New Software ->
a. Name – AVD
b. Browse and Locate your AVD
c. Select all 4itmes
d. Next
e. Next
f. I Accept
g. Finish
4. Click Window->Preference
5. Select Android tab (right side)
6. SDK Location (Browse your SDK)
7. Click OK

Categories: Uncategorized

Top 10 Interview Questions

September 8, 2011 Leave a comment

If you are looking to appear for an interview, then given below are top 10 interview questions that can help you prepare for the interview. Suitable answers are also given below:
Read more…

Categories: Uncategorized

How to Send SMS in Android

September 1, 2011 1 comment

It would be safe to say that nearly every mobile phone sold in the past decade has SMS messaging capabilities. In fact, SMS messaging is one great killer application for the mobile phone and it has created a steady revenue stream for mobile operators. Understanding how to use SMS messaging in your application can provide you with many ideas to create the next killer application.

Read more…

Categories: Uncategorized
%d bloggers like this: