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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:16:44+00:00 2026-06-14T21:16:44+00:00

just change the time according to UTC to check … but i’m getting a

  • 0

just change the time according to UTC to check …

but i’m getting a incomplete cut version on the mobile app ..

`String archiveQuery =”http://maps.googleapis.com/maps/api/directions/json?origin=RV%20College%20Bus%20Stop,%20Mysore%20Road,Bangalore,Karnataka&destination=Malleswaram,Bangalore,Karanataka,India&sensor=false&departure_time=1353850800&mode=transit&alternatives=true”;

Log.d("%%%%%%%%%%%%%%%%%%%%",archiveQuery);

       String arch=archiveQuery;
      InputStream in = null;
      String queryResult = "";
      try {
       URL url = new URL(arch); 
       HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
       HttpURLConnection httpConn = (HttpURLConnection) urlConn;
       httpConn.setAllowUserInteraction(false);
       httpConn.connect();
       in = httpConn.getInputStream();
       BufferedInputStream bis = new BufferedInputStream(in);
       ByteArrayBuffer baf = new ByteArrayBuffer(5000000);
       int read = 0;
       int bufSize = 5000000;
       byte[] buffer = new byte[bufSize];
       while(true){
        read = bis.read(buffer);
        if(read==-1){
         break;
        }
        baf.append(buffer, 0, read);
       }
       queryResult = new String(baf.toByteArray());
       } catch (MalformedURLException e) {
        e.toString();
       } catch (IOException e) {
        e.toString();
       }

try {

            JSONObject jObject;
            Log.d("%%%%%%%%%%%%%%%%%%%%",queryResult);
           Toast.makeText(getApplicationContext(), "FFFFFFFFFFFFF", Toast.LENGTH_LONG).show();
            jObject = new JSONObject(queryResult);
            JSONArray routes = jObject.getJSONArray("routes");
            String statu  = jObject.getString("status").toString();
            if(statu.equals("OK")){

                int num=routes.length();
                for(int i=0;i<num;i++)
                    {
                JSONArray legs=routes.getJSONObject(i).getJSONArray("legs");
                JSONArray steps=legs.getJSONObject(0).getJSONArray("steps");
                int l=steps.length();
                for(int j=0;j<l;j++)
                    if(steps.getJSONObject(j).getString("travel_mode").toString()!="WALKING")
                        {
                            JSONObject trans=steps.getJSONObject(j).getJSONObject("transit_details");
                            JSONObject line=trans.getJSONObject("line");
                            Log.d("@@@@@@@@@@@@@@@@\n\n\n\n\n\n\n\n\n\n",line.getString("short_name").toString());
                            Toast.makeText(getApplicationContext(), line.getString("short_name").toString(), Toast.LENGTH_LONG).show();

             }
                    }}

            else
            {

           Toast.makeText(getBaseContext(), "Suggestion not available! Please search" +
                "another placeor search in maps", Toast.LENGTH_SHORT).show();}
       }
       catch (JSONException e) {e.toString();}

      `     this is code i am using
  • 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-14T21:16:46+00:00Added an answer on June 14, 2026 at 9:16 pm

    Try this:

    HttpClient client = new DefaultHttpClient();
    HttpResponse response = client.execute(new HttpGet(url));
    InputStream is = response.getEntity().getContent();
    Scanner s = new Scanner(is).useDelimiter("\\A");
    String res = s.hasNext() ? s.next() : "";
    Log.i("JSON content", res);
    // Then parse it
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Second question of the day but hopefully simple, I just need to change the
I'm using a code to change one pivot field of just one pivot according
I have this code to change system time. This code works but somehow doesn't
I'm attempting to just change the background colour of a webpage upon page load.
Why won't the following C code compile? It seems like it should just change
I haven't really ever done a background navigation rollover, I usually just change the
I'm reusing a created Object just to change a Date and the ordinal value,
I will like to know how I can change just one color in a
I'd just like to change this cc211_AMBER_13062012i.II cc211_GROMOS_13062012i.II cc211_CHARM_13062012i.II cc211_OPLS_13062012i.II to cc211_AMBER_15062012i.II cc211_GROMOS_15062012i.II cc211_CHARM_15062012i.II
This bad boy just does not want to change size to fill the dock

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.