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 6219471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:47:17+00:00 2026-05-24T07:47:17+00:00

i want to send my data in form of json to server using post

  • 0

i want to send my data in form of json to server using post method in android.

here is my format |data1|data2|data3|<>|data11|data22|data33

hope some example since i difficult to catch the procedure of post method.

Anyidea?

Edit:

my json format |data1|data2|data3|<>|data11|data22|data33|

where each data is a plain text (text get from database)

how can create it??

  • 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-24T07:47:18+00:00Added an answer on May 24, 2026 at 7:47 am

    This blog post seems to talk about just that.

    Post JSON Using Android And HttpClient

    Edit: I saw your reply. Here’s how. Hope this does the trick 🙂

    public static void main(String[] args) {
        File file = new File("<path to json file>");
        FileInputStream fis;
        String json = "";
    
        try {
            fis = new FileInputStream(file);
    
        BufferedInputStream bis = new BufferedInputStream(fis);
        DataInputStream  dis = new DataInputStream(bis);
    
          // dis.available() returns 0 if the file does not have more lines.
          while (dis.available() != 0) {
             json += dis.readLine();
          }
    
          // dispose all the resources after using them.
          fis.close();
          bis.close();
          dis.close();
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    
    }
    

    Essentially after this you would create the string entity to send

    StringEntity st = new StringEntity(json.toString());
    

    Then just follow the steps in that link

    Haha, edit for your 2nd question: Just create a string with the text from the database. Thats all there is to it. Then create a StringEntity like the one above.

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

Sidebar

Related Questions

Is it possible to send form data to a PHP class' method rather than
I am using php/ajax to submit a form without page refresh. Here are my
I am using php/ajax to submit a form without page refresh. Here are my
I've got a form that's dynamically created using ajax (as data for the form
I am creating the user ,using asp.net + C#.there is the form (UI) who
I'm not even sure if this is possible, but I need to send POST
I'm got a form laid out like a spreadsheet. When the user leaves a
I want to include an AJAX call within a .submit() handler so that I
I have a page with File html input field and a Submit button as
I'm creating a mobile app to run on a phone and trying to read

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.