Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7912841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:42:15+00:00 2026-06-03T13:42:15+00:00

Sorry if this is a simple question, but I just can’t figure out what

  • 0

Sorry if this is a simple question, but I just can’t figure out what I’m supposed to do and I think I’m a bit out of my depth here. I want to send data from an Android Application to my application running on Google App Engine. From there the data must be written to the Datastore. My data will mostly be in the form of objects, and I am working in Java.

I came across the following question: how-can-i-connect-a-google-app-engine-application-with-my-android

I think I understand what has to happen on the Android side. I also understand how the doPost method works and what it’s supposed to do. But my problem is this, how can I now use PersistenceManagerFactory to write this data to my Datastore, or retrieve it? I.e., how would the code inside the doPost look, if I wanted to use PersistenceManagerFactory there?

Essentially, my mobile application must be able to do the same as my AppEngine application w.r.t. data retrieval/writing.

Or should I forget about this method and do something different?

Any pointer in the right direction will be greatly appreciated!

Edit:

I have started implementing Sam’s solution as shown below. However, something is still nor right. here is what I am currently doing:

Mapping my servlet in web.xml of my GAE-app:

<servlet>
    <servlet-name>this_servlet</servlet-name>
<servlet-class>*app-details*.server.JsonNews</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>this_servlet</servlet-name>
    <url-pattern>/my_app/my_app_place</url-pattern>
</servlet-mapping>

The implementation of the doPost() Method is the same as Sam’s.

In my Android-app:

DefaultHttpClient hc=new DefaultHttpClient();
ResponseHandler <String> res=new BasicResponseHandler();
HttpPost postMethod=new HttpPost("http://my_application.appspot.com/my_app/my_app_place");
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();  
nameValuePairs.add(new BasicNameValuePair("value1", "Value my user entered"));  
postMethod.setEntity(new UrlEncodedFormEntity(nameValuePairs));  
String response=hc.execute(postMethod,res);

However, the hc.execute method fails, and provides me with the following message: Internal Server Error

This leads me to believe that the error must be on the server side- but I am not sure where or why things are going wrong. I copied Sam’s code exactly, only changing the necessary things like “News”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:42:16+00:00Added an answer on June 3, 2026 at 1:42 pm

    This question solves my exact problem:

    how-to-send-a-json-object-over-request-with-android

    See dmazzoni and primpop’s answers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

sorry this is such a simple question but I can't figure it out. How
Sorry, I'm sure this is simple but I'm tired and can't figure it out.
Sorry for this simple question, but I can't solve it... There is an example:
Sorry for the beginner question, but I can't figure out cProfile (I'm really new
just a simple question here. How can I get the return value on this
Sorry if this question may be simple, but I can't seem to find an
Sorry for the simple question but I can't think of a good way to
I have a really simple question here, but I just can't find an answer
Sorry if this is a dead simple question but I'm confused from the documentation
Sorry this is a basic question, but all my research just barely missed answering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.