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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:26:22+00:00 2026-06-12T07:26:22+00:00

I am a beginner in Android. I have developed a application that will send

  • 0

I am a beginner in Android. I have developed a application that will send location information to server(latitude and longitude value).

I am using Dynamic IP as for now for sending information.

Problem which I face is while using WIFI the information is passed to the server but when I use my Mobile Internet I am unable to send the information to the server. Please help.

 Location location = locationManager.getLastKnownLocation( LocationManager.NETWORK_PROVIDER);      
    if (location != null) 
    {
    String message = String.format( "Current Location \n Longitude: %1$s \n Latitude:     %2$s  ",location.getLongitude(), location.getLatitude());
    Toast.makeText(MainActivity.this, message,Toast.LENGTH_LONG).show();
    HttpClient httpclient = new DefaultHttpClient();
    HttpPost httppost = new HttpPost("http://192.168.1.7/YourPhpScript1.php");

    try {

       List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
       nameValuePairs.add(new BasicNameValuePair("id", "12345"));
       nameValuePairs.add(new BasicNameValuePair("message", message));
       httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
       httpclient.execute(httppost);

     }
 catch (ClientProtocolException e)
    {

} 
 catch (IOException e)
   {

   }`

Here 192.168.1.7 is my dynamic IP address

  • 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-12T07:26:23+00:00Added an answer on June 12, 2026 at 7:26 am

    Its about port redirection problem,

    This ip address “192.168.1.7” is you local ip address. Which is just reachable via WIFI but when you use your mobile internet you are not in your local network.You should connect via your external ip address. But your modem probably block all your connection. Redirect port 80 from your modem to your computer and disable your computer’s firewall port 80.

    Just check all these step by step.

    1. Open port 80 from you pc’s firewall (http://windows.microsoft.com/is-IS/windows-vista/Open-a-port-in-Windows-Firewall)
    2. Redirect port 80 from your modem to your PC (Find your modem brand from list http://portforward.com/english/routers/port_forwarding/
    3. Change your application to connect from your external ip address. “http://external ip address/YourPhpScript1.php” (To find your external ip address visit http://www.whatismyip.com/)

    Your current infrastructure

      +-----+         +-------+                                     +---+
      | PC  | --------| Modem |-------- INTERNET  ~  ~   ~   ~   ~  |   |
      |     |      |  +-------+                                     |   |
      +-----+      | (external IP 75.1xx.2x.3x)                     +---+
    (192.168.1.7)  | (internal IP 192.168.1.1)               (With mobile internet)
                   |
                +---+
                |   |
                |   |
                +---+
             Mobile Phone (With wifi connection)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed an application for my android phone(Samsung GT-S5830) using SDK:2.3.3. I want
I am a beginner of Android apps and am using Eclipse. I have found
I'm beginner in Java Android developing. I'm using Eclipse SDK 3.6.1 version. I have
(note that I'm a total beginner in android programming) I have a class that
I'm a beginner in android, I'm practicing a Project that have a 2 labels
Beginner in Android development. My code crashes. I have made a simple Java method
I am implementing a Database for my (beginner/Android) application. It is not clear to
I am a beginner to android and have designed a login GUI for app
Beginner here, I have a simple question. In Android what would be the best
I am a beginner android developer and I am trying to have a button

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.