calling servlet from application

by Opal » Tue, 07 Apr 2009 02:04:57 GMT


Sponsored Links
 Hi all,

I need to call a servlet from my android app and send/receive some
data (using post method). I don't know how to do it and reading the
API doesn't help me very much. Do u know any solution or have any idea
how to do it?

I've searched this group before writing and there are some solutions
but with the older version of API.

Any ideas, samples or suggestions?

--~--~---------~--~----~------------~-------~--~----~



calling servlet from application

by Mark Murphy » Tue, 07 Apr 2009 02:13:52 GMT


 


If you use HttpURLConnection, it works the same as in "regular Java":

 http://www.exampledepot.com/egs/java.net/pkg.html 

If you use org.apache.http.*, there is documentation and examples at:

 http://hc.apache.org 

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android App Developer Training:  http://commonsware.com/training.html 

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


calling servlet from application

by mark . kahrl » Thu, 09 Apr 2009 07:03:51 GMT


 Yes that is a wonderful feature of Android, in that much of the
backend functionality is the same as 'regular' java. You can even
stream objects back and forth to servlets, no need for chossy xml/soap
type web data services.

                            M





--~--~---------~--~----~------------~-------~--~----~



calling servlet from application

by Opal » Tue, 14 Apr 2009 14:43:30 GMT


 Gr8, thanks for the clues :)





--~--~---------~--~----~------------~-------~--~----~



calling servlet from application

by Marco Schmitz » Tue, 14 Apr 2009 14:51:54 GMT


 and how do I use authentication (simple http login /pw) and how https
/ ssl (with my own licence)?

using httpclient its quite simple...

do I need to set some htttp headers on my own?

greetings,
darolla

2009/4/14 Opal <maciek.op...@gmail.com>:




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Downloading Google Docs to Device

Hello Developers,

I have been working with the gdata-client-library for the past few
days and I am officially stumped on how to go about downloading .csv
and .xls files. I've posted a question here @ S.O.

http://stackoverflow.com/questions/2813470/downloading-spreadsheets-from-google-docs

Thanks,
~Jeremy

-- 

2. Issue with launching second one

Hi,

I am trying to write a simple multiple activity application - each of which
has a xml layout file (containing a button)
On the button click, the need to switch between the activities.

My onClick() looks like this

{
        Intent myIntent = new Intent("Multi2");
        Activity act2 = new MultipleActivity();
        act2.startActivity(myIntent);
}

And I have exact replica of code in my second activity as well.

However, when I click on my button, it freezes. Sometimes, there is a force
close warning.

What am I doing wrong?

Regards,
UE.

-- 

3. Randomly generate sound from onClick and onShake events?

4. Power-loss semantics of SQlite on Android

5. Multiple Notifications - PendingIntents with different data?

6. Force Close when trying to use getApplication()

7. Android market clearly has to be full of piracy...oh well what can you do