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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:17:21+00:00 2026-06-12T04:17:21+00:00

I wanted to ask again my Question. I’m developing a restful web service that

  • 0

I wanted to ask again my Question.
I’m developing a restful web service that can be accessed from Android but I have a problem since 2 Weeks.
I want to write a service that takes some byte array from Database and write this ones to a file so that I can use this service from android.
With Android I want to get this File and then use this bytes to plot a graph.

Can you give me some Tips please!!

Thank you

  • 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-12T04:17:22+00:00Added an answer on June 12, 2026 at 4:17 am

    Web API is a good option in your case, cause is very straightforward to use it and you only need to send a simple stream.Then create your own RestClient in your app for consuming the web service, here you have some code using HttpClient for doing this:

    public void executeRequest(HttpUriRequest request, String url)  {
        HttpClient client = new DefaultHttpClient();
        HttpResponse httpResponse;
    
        try{
           httpResponse = client.execute(request);
           responseCode = httpResponse.getStatusLine().getStatusCode();
    
           HttpEntity entity = httpResponse.getEntity();
           if (entity != null)
           {
               InputStream in = entity.getContent();
               response = convertStreamToString(in);
               in.close();
           }
        } catch (ClientProtocolException e)  {
            client.getConnectionManager().shutdown();
            e.printStackTrace();
        } catch (IOException e) {
            client.getConnectionManager().shutdown();
            e.printStackTrace();
        }       
    }
    
    private static String convertStreamToString(InputStream is) {
    
        BufferedReader reader = new BufferedReader(new InputStreamReader(is));
        StringBuilder sb = new StringBuilder();
    
        String line = null;
        try {
            while ((line = reader.readLine()) != null) {
                sb.append(line + "\n");
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                is.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return sb.toString();
    }
    

    With this you can pass a GET request in order to get the data you need, if you need to add some extra parameters to the querystring this should be good too:

    public void Execute(RequestMethod method) throws Exception
        {
    
                    String combinedParams = "";
                    if  (!params.isEmpty())
                    {
                        combinedParams += "?";
    
                        for (NameValuePair p : params)
                        {
                            String paramString = p.getName() + "=" + URLEncoder.encode(p.getValue(),"UTF-8");
    
                            if  (combinedParams.length() > 1)
                                combinedParams += "&" + paramString;
                            else
                                combinedParams += paramString;
                        }
                    }
    
                    HttpGet request = new HttpGet(url + combinedParams);
    
                    for (NameValuePair h : headers)
                        request.addHeader(h.getName(),h.getValue());
    
                    executeRequest(request, url);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There's a similar question on stackoverflow , but I wanted to ask it again
just wanted to ask where I define initial class properties? From other languages I
I wanted to ask if there is any way i can get path of
I wanted to ask what is the idea behind the fact that System.String doesn't
The question I always wanted to ask and was afraid to, actually - what
Being fairly new to iPhone / Objective-C development, I wanted to ask this question
I wanted to ask if anyone knows how to move map from one div
Wanted to ask how I can add my own folders with drawables to resources?
I wanted to ask if View are really worth using. From my understanding a
I was about to ask another question on SO that this question popped up

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.