Click here to Skip to main content
15,887,821 members
Home / Discussions / Mobile
   

Mobile

 
AnswerRe: Compare mobile platforms deployment for ISV needs Pin
apvkt9-Apr-13 0:24
apvkt9-Apr-13 0:24 
Questionremove selected row in Listview android Pin
fa8725-Mar-13 22:16
fa8725-Mar-13 22:16 
AnswerRe: remove selected row in Listview android Pin
Prasad Khandekar30-Apr-13 4:46
professionalPrasad Khandekar30-Apr-13 4:46 
QuestionANDROID+Sqlserver 2008 Pin
kuldeep vatsal13-Mar-13 20:39
kuldeep vatsal13-Mar-13 20:39 
AnswerRe: ANDROID+Sqlserver 2008 Pin
Richard MacCutchan13-Mar-13 22:33
mveRichard MacCutchan13-Mar-13 22:33 
AnswerRe: ANDROID+Sqlserver 2008 Pin
aamir rafiq29-Mar-13 0:15
aamir rafiq29-Mar-13 0:15 
QuestionAndroid Socket Client Pin
Kumar Himanshu13-Mar-13 1:58
Kumar Himanshu13-Mar-13 1:58 
AnswerRe: Android Socket Client Pin
Prasad Khandekar2-May-13 5:25
professionalPrasad Khandekar2-May-13 5:25 
Hello Kumar,

You can find working examples here. Though not related to binary data transmission, but should get you started.


Below is a sample code for a function which I have used in one of the android application I developed.
Java
/**
 * Helper method to send the request to the MAP
 * @param strUrl The url to be invoked
 * @param params The name value pair list containing the parameters to be sent to MAP
 * @return the JSON response
 */
private JSONObject sendRequest(String strUrl, List<NameValuePair> params) throws Exception
{
    String line = null;
    String strCKVal = null;
    HttpPost httppost = null;
    HttpEntity entity = null;
    HttpClient httpclient = null;
    JSONObject json = null;
    InputStream is = null;
    HttpResponse response = null;
    StringBuilder sb = null;
    BufferedReader reader = null;

    try
    {
        httpclient = new DefaultHttpClient();
        httppost = new HttpPost(strUrl);
        httppost.addHeader("UserAgent","Android");
        if (!StringUtils.isEmpty(_strSesId))
            httppost.addHeader("Cookie", _strSesId);

        httppost.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
        response = httpclient.execute(httppost);
        entity = response.getEntity();
        is = entity.getContent();
        reader = new BufferedReader(new InputStreamReader(is, "UTF-8"), 8);
        sb = new StringBuilder();
        while ((line = reader.readLine()) != null)
            sb.append(line).append("\n");

        CleanupUtils.doClean(reader);
        CleanupUtils.doClean(is);

        if (sb.length() <= 0)
            throw new Exception("Server did not respond ");

        for (Header h : response.getAllHeaders())
        {
            if ("Set-Cookie".equalsIgnoreCase(h.getName()))
            {
                strCKVal = h.getValue();
                break;
            }
        }

         json = new JSONObject(sb.toString());
        _strSesId = strCKVal;
        return json;
    }
    finally
    {
        CleanupUtils.doClean(reader);
        CleanupUtils.doClean(is);
        if (line != null) line = null;
        if (strCKVal != null) strCKVal = null;
        if (entity != null) entity = null;
        if (httppost != null) httppost = null;
        if (reader != null) reader = null;
        if (is != null) is = null;
        if (response != null) response = null;
        CleanupUtils.doClean(is);
        if (sb  != null)
        {
            sb.delete(0, sb.length());
            sb = null;
        }
        if (httpclient != null) httpclient = null;
    }
}

Prasad P. Khandekar
Knowledge exists, man only discovers it.

QuestionPhoneGap Applications Pin
Sudhakar Shinde12-Mar-13 22:06
Sudhakar Shinde12-Mar-13 22:06 
QuestionPIC-32 UART Receives Only Ten Bytes Then No More Pin
C-P-User-38-Mar-13 11:16
C-P-User-38-Mar-13 11:16 
Questionhow the android mobile can fetch a voice from application on it and send it by calling Pin
saad20005-Mar-13 9:24
saad20005-Mar-13 9:24 
QuestionAPP Demographics Pin
mauricemcse1-Mar-13 7:28
mauricemcse1-Mar-13 7:28 
Questionopen layout (Main.axml) in disigner in VS2010 Pin
jojoba201125-Feb-13 23:25
jojoba201125-Feb-13 23:25 
QuestionAndroid renderscript. Pin
BupeChombaDerrick25-Feb-13 3:48
BupeChombaDerrick25-Feb-13 3:48 
NewsSolved: Pin
BupeChombaDerrick26-Feb-13 22:26
BupeChombaDerrick26-Feb-13 22:26 
Questionandroid + C# + SQL Server 2008 Pin
jojoba201124-Feb-13 21:52
jojoba201124-Feb-13 21:52 
NewsSolved ! Pin
jojoba201125-Feb-13 20:04
jojoba201125-Feb-13 20:04 
Questionwanna Email Address Hossein Khalaj Pin
jojoba201118-Feb-13 0:04
jojoba201118-Feb-13 0:04 
AnswerRe: wanna Email Address Hossein Khalaj Pin
Pete O'Hanlon18-Feb-13 0:14
mvePete O'Hanlon18-Feb-13 0:14 
QuestionUse MessageBox In the Mono for Android in the Visual Studio 2010 Pin
Rafael Soares de Almeida13-Feb-13 9:52
Rafael Soares de Almeida13-Feb-13 9:52 
AnswerRe: Use MessageBox In the Mono for Android in the Visual Studio 2010 Pin
Prasad Khandekar2-May-13 19:35
professionalPrasad Khandekar2-May-13 19:35 
QuestionWhich tablet platform is most secure? Pin
oleg638-Feb-13 8:00
professionaloleg638-Feb-13 8:00 
AnswerRe: Which tablet platform is most secure? Pin
Richard MacCutchan8-Feb-13 22:45
mveRichard MacCutchan8-Feb-13 22:45 
GeneralRe: Which tablet platform is most secure? Pin
oleg6311-Feb-13 4:50
professionaloleg6311-Feb-13 4:50 
GeneralRe: Which tablet platform is most secure? Pin
Richard MacCutchan11-Feb-13 5:06
mveRichard MacCutchan11-Feb-13 5:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.