fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
03/20/15 03:43 AM (9 years ago)

Android: is offline use possible?

Hi everybody, One more Android-for-Dummies question: with Android Studio, I created an app, generated APK, transferred it to phone with Instashare. Works great, everything seems OK (including maps). But now, if I'm not on any network (Wi-Fi or phone), the app doesn't load. It doesn't look for the embedded config, it shows an error message "Something's not right" and invites me to see the Output Console. [edit] See more precise description of this issue a few posts below... Thanks in advance for any tip! Cheers Jack
 
bigPaul
Lost but trying
Profile
Posts: 103
Reg: Mar 08, 2013
Darwin
4,530
like
03/20/15 06:19 AM (9 years ago)
Check your document behavior setting for your home screen, if it is set to force refresh it will probably cause this error as it cannot find server if there is no connection. Unless you have downloaded any offline maps, any mapping will not work whilst offline.
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/20/15 06:26 AM (9 years ago)
I didn't set anything to force refresh... Maybe it's a default setting in the BT package (new Android Studio version)? Where exactly can I check the behavior setting? (My home screen is a Menu Image Advanced)
 
bigPaul
Lost but trying
Profile
Posts: 103
Reg: Mar 08, 2013
Darwin
4,530
like
03/20/15 07:41 AM (9 years ago)
In your BT control panel for your app, select your home screen, there should be a tab there called Document Behaviour, set Force Refresh option to Allow caching and see if that helps.
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/20/15 09:02 AM (9 years ago)
Unfortunately not... as the Menu Image Advanced doesn't have such an option! Thanks anyway!
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/22/15 03:21 AM (9 years ago)
Still no clues for this issue... Let's clarify some more! When you launch an app, it compares the embedded BT_config.txt with the dynamic one (online Configuration Data), and if something changed it prompts the user to refresh. Now, what happens if the user isn't connected? (Airplane mode, or in a foreign country without data roaming and without Wi-Fi) No problem with iOS: the app uses the embedded file. Seamless, no error, no warning. And if some screens require a connection (maps, customURL, etc.), the user just gets a warning and can go on using all screens that don't require connection. Problem with Android: the user gets the error message corresponding to the string "errorConfigData", with a black screen. The app doesn't "read" the embedded BT_config.txt... and thus it doesn't load! You just get a black screen. As I'm creating travelers apps, it's a real problem. Is it an "Android Studio package" bug or some editing I have to do? [edit] I've tested some non-BT apps to see how they behave in such a situation. One is ok: you can use it and, when you try to load a screen requiring a connection, it displays a message reminding the need to be connected. Another one behaves like my BT app: you just get a black screen and, even you reconnect, you still get this black screen until you force stop it and relaunch it. Such a bad user experience should be avoided... Please keep in mind that I'm 200% newbie with Android... (I mean... with Android Studio and with Android OS!) Thanks in advance for any help! Cheers Jack
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/28/15 04:44 AM (9 years ago)
Well, the way I 'thought' it was supposed to work, was exactly like iOS. My gut instinct has always been that Android is a little like the kid that got dropped on his head; he looks ok, but something isn't quite right. That said, try this: In your Android device' 'Application Manager' clear the application cache, and see if it changes anything. Theoretically it should throw back to the internal BT_config.txt file since you're sort of 'resetting' the app. Curious... Cheers! -- Smug
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/28/15 05:35 AM (9 years ago)
Thanks for the tip, but I've already tried almost everything, including clearing cache, deleting app and reinstalling it, deleting dataURL and reportToCloudURL in the embedded config, and so on... I suspect it's some kind of bug... Hope we'll have soon some BT news about debugging of the Android Studio package! Cheers Jack P.-S. I've published an app "as is" just for my Android learning process. Here: https://play.google.com/store/apps/details?id=com.paroshotel Try it in Airplane Mode and you'll see what happens ;-)
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
04/21/15 01:13 PM (9 years ago)
Self hosted or new-improved bt android studio package?
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
04/21/15 02:02 PM (9 years ago)
Hi Chris, I'm self-hosted but for this first encounter of the third kind I've used my good ole BT account to create the app. As far as I know, we have to wait for an update of the self-hosted BT-server before playing with Android Studio on our own! So it's pure original genuine BT-hosted at the moment... And I still have this black screen when trying to use the app without connection... As being able to use an app (or parts of it) without a connection is a prerequisite for all the apps I create, I'm in some kind of dead-end now... Cheers Jack
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
04/21/15 02:22 PM (9 years ago)
You can import the self hosted in Android studio but won't make a difference o don't think. David's updated the code on the android studio package.Ill test it out today to see if I get the same results though on self hosted
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
04/21/15 02:25 PM (9 years ago)
I got the same error dialog on one of my android studio packages.I think I know quick fix.post back when I get home
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
04/21/15 10:50 PM (9 years ago)
Great! Thanks in advance, Chris!
 
Jb C
Code is Art
Profile
Posts: 1
Reg: Jul 01, 2015
Limoges
10
like
07/15/15 08:07 AM (8 years ago)
Same problem here, if you've got an idea?
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
07/18/15 06:14 AM (8 years ago)
Still stuck on it... Still no hint... Unfortunately!
 
KozmoWeb
Aspiring developer
Profile
Posts: 342
Reg: Dec 08, 2012
Sarasota, FL
8,520
like
09/08/15 06:16 PM (8 years ago)
Let me add myself to this thred as someone looking for a solution to this problem. Anyone have any luck? -William
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
09/22/15 07:32 AM (8 years ago)
Still no luck... and this thread is 6-month old now...
 
Bytewizard
buzztouch Evangelist
Profile
Posts: 32
Reg: Jul 04, 2011
Manila, Philipp...
1,020
like
11/07/15 04:36 PM (8 years ago)
Got this working already! Here's the fix. Replace the onPostExecute method code with the below code under BT_fragment_load_config_data.java file: //all done, process downloaded data... @Override protected void onPostExecute(String result) { //hide progress... hideProgress(); //config data must be loaded at this point... /// if(configData.length() < 1){ /// showAlert(getString(R.string.errorTitle), getString(R.string.errorConfigData) + " (2)"); /// }else{ /* This loading fragment can be included in any activity that implements a method named "configureEnvironment". This allows app owners to create customizable host-activities that run all the plugins (fragments)... */ //use reflection to find the method... java.lang.reflect.Method setupMethod = null; Activity hostActivity = getActivity(); try{ setupMethod = hostActivity.getClass().getMethod("configureEnvironment"); }catch(SecurityException e){ BT_debugger.showIt(fragmentName + ":loadAppDataDoneHandler. EXCEPTION (0): " + e.toString()); }catch(NoSuchMethodException e){ BT_debugger.showIt(fragmentName + ":loadAppDataDoneHandler. Current host activity does not have an \"configureEnvironment\" method implemented"); } //fire the handleBackButton method if we found it... if(setupMethod != null){ try{ setupMethod.invoke(hostActivity); }catch(Exception e){ BT_debugger.showIt(fragmentName + ":loadAppDataDoneHandler. EXCEPTION (1): " + e.toString()); } } /// } } }
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
11/29/15 09:13 AM (8 years ago)
Hey hey I had given up... (That's why I've seen your post just today!) Thanks a lot, I'll try this fix as soon as I can! Cheers Jack
 
Agu
Lost but trying
Profile
Posts: 98
Reg: Mar 06, 2014
GRANADA
980
like
12/16/15 02:46 AM (8 years ago)
Works for me, Thanks!!!
 

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.