• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

LocationManager Help for app

I am attempting to get latitude and longitude values into a URL in a android application anybody that can offer help would be my best friend :D


I cant seem to figure out how to declare
String Lon = new Double(loc.getLongitude()).toString();
String Lat = new Double(loc.getLatitude()).toString();
so that they work.

Kind of a noob here but have tried all I can think of

Code:
package comm.ca;

import comm.ca.R;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.location.LocationManager;



public class BrowserAct extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.browser);
        WebView mWebview = (WebView) findViewById(R.id.webview);
        mWebview.getSettings().setJavaScriptEnabled(true);
        String Lon = new Double(loc.getLongitude()).toString();
        String Lat = new Double(loc.getLatitude()).toString();
                mWebview
                .loadUrl("example=" + Lat + "&textField2=" + Lon);
    }
    
    
}
 
Back
Top Bottom