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. Android Service - Cannot access location

Hello Experts,
I am new to Android ... so just exploring ...

I created an application that  starts a service. This service is
expected to run in background. This service has to access the
Location.
I am currently unable to do so ... I have given permission to my
Manifest file ..

I think the issue is that the application has the permission, but the
Service does not !
What happens is that the service keeps running even if the application
is stopped ..

Does the Service need special / different permissions ?
How do I assign permissions to Service ( my service class extends :
Service)


Please help.

Thanks in advance.

Regards
Varun

-- 

2. Android search dialog - SingleTop

I'm adding search to my app following the instructions found here:
http://developer.android.com/intl/de/guide/topics/search/search-dialog.html.

When I make my main activity searchable, then I can search it. But, I
found the multiple search screens after multiple searches to be
annoying since I have to press back through each one. The instructions
also addressed this by suggesting I create a separate search activity
with android:launchMode="singleTop". According to the instructions, if
I add the following Meta tag to my Application in the manifest, then I
can get the searchable activity from any screen.
<meta-data android:name="android.app.default_searchable"
                 android:value=".MySearchableActivity" />
However, when I try this, the searchable activity does not start when
I press the search button. If I make my searchable activity the main
activity, it works. What am I missing?

Here's my searchable activity in the manifest:
    <activity android:name="Search" >
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>
        <meta-data android:name="android.app.searchable"
                   android:resource="@xml/searchable"/>
    </activity>

-- 

3. New app listing order in Market app search

4. Separate Thread to read system time

5. Using google map api on phones without the map library?

6. Developer with 26 apps gone from the market

7. Simple Context Menus