- This topic has 6 replies, 3 voices, and was last updated 10 years, 8 months ago by mobio9471.
-
AuthorPosts
-
mobio9471MemberHi,
I develop an app using mobione and have some JavaScript code implemented to phoneui.documentReadyHandler for initializing purposes. Everything works fine. Including the Simulation on web simulator (Android 2.3.2). But when I build the app and install it to my mobile (Samsung SII Android 2.3) it seems to me, that phoneui.documentReadyHandler is not invoked at app-startup. Because no initialization happens. The app-functionality is completely available. There are some functions invoked inside AND outside phoneui.documentReadyHandler. The outside invokations perform correctly. But there are no invokations inside .
Any suggestions ?
BrandonMemberHave you tried placing it inside the custom.js file documentready function to see if it is called there?
mobio9471Memberphoneui.documentReadyHandler is located inside <name>_custom.js . The code for initialization is located inside the handler function. In simulation the code works well, but in the mobile it looks like the code doesn’t .
Any idea what the problem is ?
BrandonMemberI know a lot of people dont like to post their code. But its hard without seeing code to trouble shoot problems.
My first step would be to verify your code doesnt contain any errors. If you dont want to post it use this to check it:If you can post it it may help to find the problem (providing the forum lets you post it…)
mobio9471MemberHi Brandon,
thank you very much for your reply.
>I know a lot of people dont like to post their code. But its hard without seeing code to trouble shoot problems
You are right, but I don’t want you to do the work for me, I am glad if you help me to overcome my limits and give me the ideas I never would get on my own because of the lack of experience.
So I decided to make a new attempt to find the problem before to post the code.
I followed the link that you posted. I got the idea from it, that there could be something wrong with the availability/accessability of the js code.
I simplified my problem and put only a text field to my startup screen. I tried to change the content on startup by jQuery statement like this
/**
* Called when document is loaded.
*/
phoneui.documentReadyHandler = function() {
$(“#m1-test-text1”).text(“newContent”);
}Nothing happened.
I remembered that I some time before did rename the startup screen from AppName.mobi to appName.mobi via windows file explorer. After building the App again, all files also renamed except AppName_custom.js and AppName.json. I renamed them manually.
The result of this action was that everything even the js code (eg. button action handlers, other functions etc) worked as expected …
.. except the code inside
phoneui.documentReadyHandler = function() { }
So I decided to make the startup screen from scratch.
Now everything works as expected.
Including the code inside
phoneui.documentReadyHandler = function() { }From my point of view the renaming action may have caused the problem.
Does there exist any (official) alternative to rename the screen.name to avoid this problem ?
support-octavioMemberHi mobio9471,
>Does there exist any (official) alternative to rename the screen.name to avoid this problem ?
You can rename the old custom js file and move it to the new generated www folder location to match the new startup file.
mobio9471MemberHi octavio,
That means, renaming by creating a new .mobi file build it and copying the related files.
thank you very much for you reply ! -
AuthorPosts