sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
01/08/16 02:04 AM (8 years ago)

Emulator runs an old version of my app

I'm finding the Android side of things a bit complicated - using Android Studio and my app consists of * Menu with image * Custom html The only funky thing I'm doing is generating BT_config.txt from a custom CMS and I've ironed out all the wrinkles using the ios app. The app download had the original config, and I've cut and pasted in my version. When I run my app in the emulator I'm getting the version of the app from when I first started testing - and it's using the official BT_config.txt and when it refreshes it is getting it from the BT servers (as you'd expect). How do flush the memory so that it recompiles when I run. I'm using OSX, Android Studio, Marshmallow Android 6.0 x86 thanks :)
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
01/08/16 02:14 AM (8 years ago)
1) Delete the app from the simulator and install it anew. In some cases, Android Studio will not install the new version, so enter any plugin and add any meaningless statement such as String aaaaaaa= ""; into the body of any method in any Java file. That should force AS to recompile the app and install it anew. 2) The BT way of doing things would be to go to the control panel for the app, click on JSON Data, copy all the text of the JSON to file /assets/BT_config.txt save and recompile. That way, your app shall always start with the latest version from the server.
 
sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
like
01/08/16 04:40 AM (8 years ago)
Thanks Dusko. I've made a few changes, redownloaded the app, checked everything over and over. I guess I've made progress because now I get an error when I open the app that there is a problem with my config file (ios is still happy). The app tells me to check my Output Console. So I have a Gradle Console and that just tells me that the build was successful but it's throwing errors on my config file. I dug around and finally found the Android Monitor (gawd, it's a pain being a newbie) which showed me that BT was adding "&currentMode=Design" to the end of the config url which was breaking the url. I updated my scripts so that filler was in my server's copy of the config file. I then went back to BT, changed the application core field's config file to have ?filler=1 on the end so that when "&currentMode=Design" gets tacked on the end the server can still do it's thing. I checked that in the config data screen that filler had been added, I went to publish and updated the version number and published. I then went and redownloaded the project and imported into Android Studio and imported the new project - checked the config file had filler. I even did the String aaaa = ""; bit. However when I run the app it's calling the old version without filler. Frustrating, but on the plus side, I'm getting alot more comfortable with Android Studio :)
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
01/08/16 04:55 AM (8 years ago)
Please confirm that you have deleted the old app from the simulator and / or device. Also, don't bother testing on the simulator too much, you really should have an Android device to test with. Personally, I don't bother with this Live or Design current mode -- that was broken long ago and we hope when the new version of BT comes out, that that will be one of many things that is improved / debugged. I get impression that your CMS is creating the JSON for the app. Is that so? If it is so, did you check the generated JSON through a JSON lint checker? Is JSON valid or not? If valid, that will be one thing less to worry about. >I went to publish and updated the version number and published. Did you publish the app on Google Play store? That seems a bit premature, given that you are still testing!? Let us know more about your adventures with AS!
 
sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
like
01/08/16 05:28 AM (8 years ago)
lol, definitely not on the play store, just in the BT app builder. I'm not worried about the design mode, that's being added by BT - in the downloader script and I'm just allowing it to work. The json validates fine. The problem is that my config file is at /navigations/mobileconfig but BT is turning that into /navigations/mobileconfig&currentMode=Design webservers look at the "&" and have a hissy fit and spits out an html error page so I've changed the url to be /navigations/mobileconfig/?filler=1 which lets BT turn it into /navigations/mobileconfig/?filler=1&currentMode=Design and the webserver is happy and delivers the json file as expected. I hadn't been deleting the old versions because it was kind of helpful having the incremental version numbers. Off to delete them now though. Have an Android phone in my lap, ready to go. 1:26am is kinda late and I have to be up at 4:45am to catch a plane. Methinks I can sleep later :)
 
sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
like
01/08/16 06:19 AM (8 years ago)
Still can't get the emulator to play nicely but I was able to generate an APK file and test that on BlueStacks and it worked as expected. Success!!!
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
01/08/16 06:54 AM (8 years ago)
>Success!!! Congratulations then!
 
sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
like
01/08/16 07:01 AM (8 years ago)
Yep, just got it loaded on the phone too. Now to catch a precious 90 minutes shuteye!
 

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.