daku7
Aspiring developer
Profile
Posts: 227
Reg: Oct 30, 2011
Toronto
3,170
05/14/12 10:23 PM (13 years ago)

Google Maps Custom URL Plugin Android BT 2.0

Hello, I have created a webpage that takes the current location and displays property listings near by. This works great in iPhone But in Android, the Google Maps does not show. Just a blank screen. The Our Location menu works fine, I can see the map and device current location. So I know that my Google Maps API Key is working fine. Also if I launch the URL from the android web browser it works great. BUT it does not work if it is launched from the app menu. I am using the Custom URL Plugin for self hosted V2.0.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/14/12 10:36 PM (13 years ago)
Do you have the DebugAPIkey? If so, delete it. Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/14/12 10:43 PM (13 years ago)
Hi @daku7, In your res/laout/screen_map.xml file, find the line that says: android:apiKey="@string/googleMapsAPIKeyDebug" Change this to read: android:apiKey="@string/googleMapsAPIKeyRelease" Make sure your Google Maps Release API key is specified in your res/values/strings.xml, rebuild your project, and you should be good to go! Mark
 
daku7
Aspiring developer
Profile
Posts: 227
Reg: Oct 30, 2011
Toronto
3,170
like
05/14/12 10:58 PM (13 years ago)
@Fred, Yes, I have already done this. @GoNorthWest, Yes, I have already done this. Google Maps work fine on the Map. I have a menu plugin called Location Maps and it works fine. It show the current location. The problem is that this URL works fine in the Android Web Browser BUT if I add this URL to a Custom URL Plugin it does not work.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/14/12 11:17 PM (13 years ago)
Try the Launch Native App (browser) plugin. Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/14/12 11:34 PM (13 years ago)
Hey daku7, I'm wondering if you need to pass location information with the URL in order to get this to work? Something like this: mapsearchoffice.aspx?latitude=<blah>&longitude=<blah> (I know I totally mixed ASP and PHP syntax there, but I have no idea how it works in ASP). I can see how the Android web browser might automatically pick up the location...when I launched the URL on my laptop in FireFox, it asked to use my location. But, I'm wondering if the webView screen in the app is a bit different, in that it doesn't automatically carry the location info? Mark
 
daku7
Aspiring developer
Profile
Posts: 227
Reg: Oct 30, 2011
Toronto
3,170
like
05/14/12 11:35 PM (13 years ago)
@Fred I found this on Buzz Touch. Will this work also. a) look for Screen_CsutomURL.java file b) Scroll down to the public boolean shouldOverrideUrlLoading(WebView view, String url) method c)Enter the following code //capture AppBuilder URL if(url.contains(appbuilder)){ useNativeIntent = 1; }
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/14/12 11:39 PM (13 years ago)
I say give it a try and see what happens!
 
daku7
Aspiring developer
Profile
Posts: 227
Reg: Oct 30, 2011
Toronto
3,170
like
05/14/12 11:41 PM (13 years ago)
@Fred I found this on Buzz Touch. Will this work also. a) look for Screen_CsutomURL.java file b) Scroll down to the public boolean shouldOverrideUrlLoading(WebView view, String url) method c)Enter the following code //capture AppBuilder URL if(url.contains(appbuilder)){ useNativeIntent = 1; }
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/14/12 11:47 PM (13 years ago)
Don't know
 
daku7
Aspiring developer
Profile
Posts: 227
Reg: Oct 30, 2011
Toronto
3,170
like
05/14/12 11:50 PM (13 years ago)
Sorry, Deleted the duplicate post
 
daku7
Aspiring developer
Profile
Posts: 227
Reg: Oct 30, 2011
Toronto
3,170
like
05/15/12 12:07 AM (13 years ago)
Sorry about the duplicate post above. Clicking refresh on browser does this. @GoNorthWest, I can't do this because I need the current location from the device. @Fred, Launch Native App (browser) plugin works but, the page load in the separate web browser outside of the app. I want this page to load inside the app.
 
Rishav
Code is Art
Profile
Posts: 153
Reg: Jan 26, 2012
Dubai
8,780
like
05/15/12 01:13 AM (13 years ago)
@daku7, You can send the device's current location using this variables [deviceLatitude] A latitude coordinate value (if the device is reporting it's location). [deviceLongitude] A longitude coordinate value (if the device is reporting it's location). For more see sending device data in URL in custom URL page.
 
daku7
Aspiring developer
Profile
Posts: 227
Reg: Oct 30, 2011
Toronto
3,170
like
05/15/12 09:21 AM (13 years ago)
@elecy where can I find more information about this? Will this work for iPhone and android?
 
Rishav
Code is Art
Profile
Posts: 153
Reg: Jan 26, 2012
Dubai
8,780
like
05/15/12 10:35 AM (13 years ago)
In the Custom URL screen just above the box where we enter the page url..It works for both android and IPhone..Don't forget to enable start tracking user location in the core properties.
 
daku7
Aspiring developer
Profile
Posts: 227
Reg: Oct 30, 2011
Toronto
3,170
like
05/15/12 05:35 PM (13 years ago)
@elecy, this works in iPhone but it doesn't work in Android. Here is the test URL I created. I have the start tracking user location enabled. For some reason custom URL for Android will not display Google Maps.
 
daku7
Aspiring developer
Profile
Posts: 227
Reg: Oct 30, 2011
Toronto
3,170
like
05/16/12 04:27 PM (13 years ago)
Please help me out. Why will this URL not work in Android? and it works in iPhone. I can use the "Launch Native App" for this URL and it works for Android BUT it takes the user out of the app and opens the Android Browser.
 
Rishav
Code is Art
Profile
Posts: 153
Reg: Jan 26, 2012
Dubai
8,780
like
05/16/12 11:13 PM (13 years ago)
Sorry for the late respone but i think removing the code which tries to obtain the user's location can work. As i see the page even after passing the coordinate through variables, asks for user location and maybe the webview might be blocking that request.
 
daku7
Aspiring developer
Profile
Posts: 227
Reg: Oct 30, 2011
Toronto
3,170
like
05/18/12 12:22 AM (13 years ago)
@elecy, Thanks. This solved my problem. I removed the code which tries to obtain the user's location and the it works now.
 
Rishav
Code is Art
Profile
Posts: 153
Reg: Jan 26, 2012
Dubai
8,780
like
05/19/12 12:02 AM (13 years ago)
Nice to hear that...
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.