Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 89

miku
Aspiring developer
Profile
Posts: 405
Reg: Feb 20, 2014
zagorje ob savi
10,600
10/28/15 04:08 AM (9 years ago)

Smugs Location menu Android

It is really good plugin and works fine on iOS. Now I tried the same on Android: I use the same Screen data URL as in iOS, and all settings are the same. On device I see only blank screen with original banner image "sw_banner_tumon.png", which I left in Banner Image CP. I tried in both Android Studio and Eclipse, I also have Google Map API installed. Did I forget something to change?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
10/28/15 07:46 AM (9 years ago)
Please send me a private message with your dataURL so I can test it. Also, any screen shots or log files would be useful. Google API? It doesn't use the Google Map API. If it works fine in iOS, then it 'should' work ok in Android as well. Let's find out what's up and get you going. Cheers! -- Smug
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
10/28/15 08:01 PM (9 years ago)
Ok, I think I found the problem. I got it to work in my Android (on an emulator, no less). And there isn't really a problem with the code, it's just that Android is a bit more particular about the data you feed it than iOS is. Example of working demo: https://dl.dropboxusercontent.com/u/115208762/locmenu.png I didn't plug any valid location data in the example, so no distances were displayed, but that still should not be a problem for you; just make sure your device has location/gps turned on. Although your JSON is 'valid', the spaces and some odd characters are causing an issue. Using your test data did not work, due to 'spaces' being in the json. I guess iOS doesn't mind, but Android (Java) does. https://dl.dropboxusercontent.com/u/115208762/jsonsamp.png When I ran your data through 'jsonlint.com' and it formatted the json properly, everything worked fine. https://dl.dropboxusercontent.com/u/115208762/jsongood.png My suggestion is to check your 'generator' (whatever creates your json) and modify it to remove those spaces. That should fix you up, but let me know if you have further issues. Cheers! -- Smug
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
10/29/15 12:56 AM (9 years ago)
(To the general public, Miku sent me his project, because it still did not work. I took a look, and decided to answer here, because it affects 'all' Location Menu users. Probably.) Ok, that one is my fault. I found that my RegEx for 'http' isn't working, so I simplified it. In SW_locationmenu.java, around line 239ish will be the 'onStart' method. On line 242-ish Change the following from: boolean hasURL = dataURL.matches("(?i).*http*"); to this: boolean hasURL = dataURL.toLowerCase().contains("http"); save it, and it should work. If not, you know the drill. :) Cheers! -- Smug I'll fix this in the next scheduled update.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
10/29/15 01:05 AM (9 years ago)
One thing separate from 'my' plugin software, were modification for BT Android that I needed to throw in to make it all work in Android Studio. In a nutshell I had to perform the following my my 'Module' build.gradle file: 1) Move the compile SDK to the most recent (for me, 23) 2) add this line under 'buildToolsVersion' line, to allow for other BT functions: useLibrary 'org.apache.http.legacy' 3) copy 'gcm.jar' into the libs directory. I also had to create the libs directory. 4) add this line under 'dependancies'. The existing google compile should be removed: compile files('libs/gcm.jar') compile 'com.google.android.gms:play-services:8.1.0' of course, your google play services version should match the one you have. All of this is done in your module (application) build.gradle file. Hope this helps. Cheers! -- Smug
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
10/30/15 04:54 AM (9 years ago)
Thank you for the kind review of my Plugin :) I hope this means that your project is running and the plugin works well for you! If not, don't hesitate to yell. Cheers! -- Smug
 

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.