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

  • Home
  • SEARCH
  • 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 6746799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:21:55+00:00 2026-05-26T12:21:55+00:00

I am new to android development and now i am developing an e commerce

  • 0

I am new to android development and now i am developing an e commerce application in android for online shopping.So far in this project i have created a shopping cart to hold articles selected by user. But every thing i have done works statically.

Now i have to communicate with the server to get updates about products and discounts.

I know how to consume webservices using json.

1.I am confused about that everytime i start my application i should communicate with server using webservice ?? or should i store the data in application when application is executed for the first time on device.

2.And what approach to store data should i follow

I should store it in device cache or
I should store it in applications sqlite db

Edit :
get data from webservice

try {
            Log.v("inside webservice call ", "1");
            HttpPost request = new HttpPost(url);
            request.setHeader("Accept", "application/json");
            request.setHeader("Content-type", "application/json");
            // Build JSON string
            Log.v("inside webservice call ", "2");
            JSONStringer JsonString = new JSONStringer().object().key("prodid")
                    .value("4057339").endObject();

            StringEntity entity = new StringEntity(JsonString.toString());
            request.setEntity(entity);
            Log.v("data", JsonString.toString());
            Log.v("inside webservice call ", "2");
            DefaultHttpClient httpClient1 = new DefaultHttpClient();
            HttpResponse response = httpClient1.execute(request);
            Log.v("inside webservice call ", "3");
            Log.v("response code", response.getStatusLine().getStatusCode()
                    + "");
            HttpEntity responseEntity = response.getEntity();
            // Read response data into buffer
            char[] buffer = new char[(int) responseEntity.getContentLength()];
            InputStream stream = responseEntity.getContent();
            InputStreamReader reader = new InputStreamReader(stream);
            reader.read(buffer);
            stream.close();
            Log.v("inside webservice call ", "4");
            results = new JSONObject(new String(buffer));
            // Populate text fields
            String message = results.getString("message");
            String isvalid = results.getString("isvalid");
            Log.v("tag", message + isvalid);
            Log.v("inside webservice call ", "5");
        } catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
        }

I do this to get data from server

but unable to put this data in sqlite db please guide me

  • 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-05-26T12:21:56+00:00Added an answer on May 26, 2026 at 12:21 pm
    1.I am confused about that everytime i start my application i should communicate with server using webservice ?? or should i store the data in application when application is executed for the first time on device.
    

    This totally depends on your requirement of the project,means if the data is going to be updated frequently then you should load it everytime,you can also load data periodically and if possible make one extra service from server that notify you for updates and you just need to check that only everytime.

    For the images and other media you can store them to SDCard once and next time just check if they alreay exist then don’t go for loading,this can save your process time.

    2.And what approach to store data should i follow 
    

    To store the data as you are loading many specific and formatted and categoriesed information then sqlite db would be more help ful to store and retrieve data.

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

Sidebar

Related Questions

Hey guys i am new to android development, I am developing a project which
I am very new to android development.... i have created an app and want
I'm brand new to Android development and right now I am building a simple
I'm new to android development and as a pet project I wanted to try
I'm new to Android development and working on an Android application that requires the
I installed new SDK for android development. Now when I open Layout XML file
I am very new to Android application development. I successfully added some backgrounds to
I am new to Android development and I have a question regarding custom views
Hi I am new into android development and I am having trouble into this
I a new to Android development, so this is kind of a basic question.

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.