Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 43    Views: 51

FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
06/09/14 11:40 AM (10 years ago)

Help with App Stalling on startup

I have a live app uktheatres in the app store, its a complete listing of all uk theatres, there is 3775 screens, the problem i have is its stalling on start up and refresh, while i,m aware i have to eventually take all the child items and put them in a database, which would speed the whole app up, at the moment i need to make the app start quicker, at the moment i don't need to add or change anything within the app so if i take out the Configuration Data URLReport to Cloud URL will this stop the app from looking to theses at startup and speed the start up on the app. i am going to include all the icons and images within the app on the next itunes update which will hopefully speed it up internally as well, i just need something to speed up the start of the app while i get everything into a database. https://app.io/U4dLuS https://itunes.apple.com/us/app/uk-theatres/id875279859?ls=1&mt=8
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
06/09/14 12:42 PM (10 years ago)
Whats the size of your config.txt file? P.s: in which one is Miss Saigon playing? Dying to see that again.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/09/14 12:56 PM (10 years ago)
The config file is quite large, If I host that somewhere else will that help
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
06/09/14 01:02 PM (10 years ago)
Its my understanding that thats what's why it takes so long for the app to load. each time you load the app it reads through the config file. Only way around it (that I can see) is making it smaller. For example, if you have a menu screen with 50 buttons on the control panel. All those entries will go into the config file. Lets say you have it pointing to remote location, where the info on the buttons would be, you'd still have 50 buttons, but only one entry on the config file. Down side to this, the menu would load up a bit slower. I prefer have it load slower in the begging and then everything loads great. Maybe try adding and image or something while it loads, to inform user that it's (updating data) or something..
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/09/14 01:11 PM (10 years ago)
I have lots of screens with 4 buttons, would hosting them externally help, and how would I do that, remember I still noob lol the losing screen sounds good, but how would I do that
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/09/14 02:08 PM (10 years ago)
I have lots of screens with 4 buttons, would hosting them externally help, and how would I do that, remember I still noob lol the losing screen sounds good, but how would I do that
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/09/14 03:05 PM (10 years ago)
On my phone your app takes about 4 seconds to load and about 13 seconds to do a refresh. The refresh downloads your whole config over the internet. You can probably avoid the 13 second delay by stopping the report to cloud url, most of the 4 seconds is probably the time loading your local copy of the config. The problem is that the overall number of menus and screens you have is a lot. Reducing the config will improve startup performance, but your other screens may be slower to load if you keep the same basic app design. Its just a big app!
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/09/14 03:41 PM (10 years ago)
thanks alan, ive no problem with 4 sec delay as, as you say its a big app, and it speeds up after its used, i will try removing the report to cloud, i did try it today and it didn't make any difference, but i will try again and remove the app and download new one.hopefully that will work then. thanks guys
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
06/09/14 03:44 PM (10 years ago)
What device are you testing it on?
 
krompa
Lost but trying
Profile
Posts: 257
Reg: Jun 14, 2013
Bristol
8,820
like
06/09/14 04:18 PM (10 years ago)
3775 screens - RESPECT
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/10/14 12:06 AM (10 years ago)
im testing on iphone 4 and ipad and iphone 5 simulator
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
06/10/14 05:09 AM (10 years ago)
Every screen should have its own childItems.txt file that gets loaded via dataURL. Along with not using URLs to show common elements such as buttons and often used images. I explained this on another post by funky monkey. -- Niraj
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/10/14 06:13 AM (10 years ago)
i am doing that now niraj, I'm putting all the details into access and then transferring into a database, but i needed to get it all finished and then somehow speed up the start of the app, while I'm figuring out the database side . cheers sean
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
06/10/14 04:42 PM (10 years ago)
Even with a database, don't compile all screens into a big config file. :-)
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/11/14 01:49 AM (10 years ago)
how do you mean niraj, how do i split the files up, what format do i put them in and how do i host and point from here to wherever I've hosted them cheers
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/11/14 03:01 AM (10 years ago)
You've mentioned database a couple of times, just wondering what that is for? I can't see how that would improve performance. Is it to make adding data easier?
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/11/14 03:06 AM (10 years ago)
Btw, I think Niraj is talking about using the "Screen Data URL" option which is available for some screens. Some people use that to load each menu separately instead of keeping it all in a single config.txt. You might need to get your head around how that can work for your app, as if you do it, you would end up not using the control panel for directly editng the menus when you make change.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/11/14 04:58 AM (10 years ago)
once the info is finished theres no need for me to change anything within the theatre info, so if having separate info held externally for the theatres is going to speed the app up, then thats probably the best way forward, what i could do with, is an idiots guide to doing the above, as I'm still new at the code side of things, so trying to figure out exactly what i do, is making my eyes squint a bit lol cheers guys
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/11/14 06:14 AM (10 years ago)
ps what happens to the app when i remove both the Configuration Data URL and the Report to Cloud URL, will the app still function as it functions now. I want to repackage a new version to the store, with all the images with the app, instead of hosting them externally, i also want to test out some of the advice above without affecting the app.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/11/14 11:41 AM (10 years ago)
The way to load your menu from a remote URL is to create a text file with the menu json information and load it to somewhere - you can for example use the Files/Media > Documents area of your control panel and link to it. You can create the text content by cut and paste of the relevant menu info from you apps config.txt. You might wantt to create a simple app with just a menu to work out the json constructs. To load the text file into the plug-in page, first you need to work out the URL of your text file. You can do that by clicking on the link for it in the Files/Media section. Then, in the Location plug-in control panel > Screen Data URL, enter that URL. Now, the plugin will load the menu info from your text file instead of the control panel - voila! No coding required.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/11/14 11:43 AM (10 years ago)
PS to answer your question "what happens to the app when i remove both the Configuration Data URL and the Report to Cloud URL, will the app still function as it functions now. " It becomes an offline app.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/11/14 12:12 PM (10 years ago)
thanks alan, that helped loads, will try test app first, then implement it into the main app, while offline will the app still funtion\work as it works while online. (Im aware i have to upload new binary to get it online again)
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/11/14 12:23 PM (10 years ago)
"while offline will the app still funtion\work as it works while online?" If you go offline, any changes you make on the control panel won't get through to your app. I don't think there should be any other effects. I still can't get my head around how a database helps ...
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/11/14 12:31 PM (10 years ago)
thats good, i can take the app offline then, im aware that it wont recieve any updates, but thats good while i repackage it and try out your suggestions above, cheers alan
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/11/14 01:41 PM (10 years ago)
You're welcome, glad I could help.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
06/11/14 10:21 PM (10 years ago)
Database is for easier content management and for automatically generating the JSON for each screen. Compiling the images into the app will indeed make the startup be quicker -- that is a good first step towards optimization. Go offline last -- it won't affect performance. -- Niraj
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/12/14 12:21 AM (10 years ago)
thanks niraj, will do :)
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/12/14 02:31 AM (10 years ago)
Hi - I don't want to disagree with anyone, but I'm wondering why going off-line will not affect performance? The problem reported is that refresh takes a long time (14 secs). Going off-line will eliminate refresh. Startup takes around 4 secs. Of course, with re-arrangements of where how menus are loaded, both could become even less, but wouldn't going off-line always improve the problem?. On the database front, if the app doesn't change much and is intended to be offline, then it won't add much benefit, as although a database driven json structure may make content changes easier, am I right in thinking there won't be many?
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
06/12/14 06:19 AM (10 years ago)
Once he pares down the bt_config.txt file, then a refresh will be rather quick. Especially when the images are compiled into the package rather than downloaded by URLs. A refresh clears out all downloaded items and causes all those items to be re-downloaded. Even if an image did not change, it gets deleted and re-downloaded. I imagine shows will change, thus the need to remain online for content updates. -- Niraj
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/12/14 11:25 AM (10 years ago)
Cheers Niraj, I see where you are coming from now
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/17/14 10:53 AM (10 years ago)
taking the app offline hasnt speeded up the app , it still loads slowly, so i guess its all the child items in the config file,
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/17/14 10:57 AM (10 years ago)
alan, so i copy and paste the json to a text file, host that externally on my server, do i add the text element from the screen to the json file
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/17/14 11:14 AM (10 years ago)
What do you mean by "text element from the screen"?
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/17/14 11:32 AM (10 years ago)
you said "The way to load your menu from a remote URL is to create a text file with the menu json information and load it to somewhere - you can for example use the Files/Media > Documents area of your control panel and link to it. You can create the text content by cut and paste of the relevant menu info from you apps config.txt. You might wantt to create a simple app with just a menu to work out the json constructs." So i,m creating text file, with the jason from the screen and adding the extra text from the screen from the main config file, i checked the jason was ok, then put the file on my website server, got a url and put it in the Screens "Screen Data URL" is that right dude Sean
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/17/14 11:59 AM (10 years ago)
When I did this I took the json from the config.txt only, dropped it into a text file and linked to that text file in the control panel. So apart from you using the json from the screen itself (which I think you do not do), sounds good.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/17/14 12:02 PM (10 years ago)
ah ok, how do you know its worked, will the screen automatically switch to the url file, as ive linked the file i did above, and ive not noticed any change
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/17/14 12:03 PM (10 years ago)
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/17/14 12:05 PM (10 years ago)
Refresh your app, if it works, then malform the url (temporarily) refresh again and it shouldn't work
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/17/14 12:18 PM (10 years ago)
the screens still showing after i adjust the url, exept for screen before it, saying it had problems downloadeing some data, is it just showing whats in the memory
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/17/14 12:18 PM (10 years ago)
ps sorry if im sounding stupid, been long hot day :)
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/17/14 12:46 PM (10 years ago)
No worries Sean, I'm just chillin', watching the footy, occasionally looking at emails. It's not easy debugging code, especially when its not mine and I can't see it lol. What I would do is try making a dead simple app with one menu, test linking external json on that. Its easier to learn on something simple, then build on that when you are confident that you know how it works.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/17/14 01:32 PM (10 years ago)
ok thanks dude
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
06/17/14 11:18 PM (10 years ago)
In your case, the menu items would come from a Server sitting at the dataURL. To verify the text file, loading the dataURL in your browser would produce output like this: { "childItems":[ { "itemId":"menu_1", "itemType":"BT_menuItem", "titleText":"This is row 1", "loadScreenWithItemId":"1234" }, { "itemId":"menu_2", "itemType":"BT_menuItem", "titleText":"This is row 2", "loadScreenWithItemId":"5678" }, { "itemId":"menu_3", "itemType":"BT_menuItem", "titleText":"This is row 3", "loadScreenWithItemId":"2948" } ] } Note: If using a URL, use: "imageURL":"http://mypicture.com/myimage.png", instead of "imageFileName": "my_picture.png", I copy-pasted that information from the bottom of the Menu with Image plugin's page: https://www.buzztouch.com/plugins/plugin.php?pid=F018606BDA6027B90A3ED49 Start with a small example app as Alan had suggested. Build up your knowledge and skills with a crawl-walk-run approach. We have confidence in you ... You can do this! :-) -- Niraj
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/17/14 11:51 PM (10 years ago)
thanks niraj, how do you mean image url, do you mean the image from the screen,
 

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.