Worklight hybrid android project stuck on IBM logo? - android

I created a hybrid project which creates a default 'Hello Worklight' page which successfully runs on the android emulator... Now i replaced the default HTMl page with a different page along with its css and javascript folders... I rebuilt the project... It builds without any errors... But when the apps launches in the emulator....the app is just stuck on the IBM logo... I can see no errors in the logcat, that is why i cant figure out whats the problem... Do i need to modify something when i replaced the default HTML age? Help please....

You cannot simply "replace" the contents of index.html with some other content.
The file MUST contain the following:
Reference to css/main.css in the HEAD
References to the following in the BODY
js/initOptions.js
js/main.js
js/messages.js
Without these (and especially initOptions.js and main.js), the app will indeed get stuck on the splash because you will fail to load the Worklight framework, so nothing will work...
Instead, you need to ADD to it (additional references, content, etc).
Explain what you're trying to accomplish...

Related

Compiling app to browser or android and showing old code

When I build my Cordova app sometimes the correct HTML and CSS is displayed but other times I'm missing entire HTML blocks and css files. I've tried building multiple times and running on Browser/Device but it still shows the old app. I've also tried deleting the platforms folders re-adding the platforms and then building but still no luck.
Anyone had this issue and know how to solve it?
Empty the browser cache and then restart the browser.

Meteor mobile application seemingly not loading outside assets

Here is my issue, I am using Bootstrap (twbs:bootstrap), font-awesome (natestrauser:font-awesome) and Avatar (utilities:avatar).
When I load my application in a desktop browser, all assets load fine.
When I load my application in a mobile browser, all assets load fine.
But when I load my application in the compiled (Android) app, font-awesome and Avatar don't load their assets. The reason I am targeting them is they are both reliant on contacting outside sources. font-awesome is served off of a CDN and Avatar retrieves avatars from social networks. I know I can package font-awesome but I can't do the same for avatars so I need to figure this out.
I have looked to see if Meteor does something odd like sandboxing the app to prevent outside contact but I can't seem to find any mention of these kinds of issues. Is there a default security settings that I can set where it would allow my app to 'contact' whitelisted sites? It would be absurd but it is Meteor after all.
I figure someone more knowledgeable in Meteor can point out my error.
There is no code for font-awesome (besides using CSS classes) and there is really no specific code for Avatar besides {{> avatar ... }}
Thank you in advance!
Note, as of 5/30/2017: Please skip to EDIT 2 below unless you want to read the very long and confusing ramblings of my former self. Thank you.
Okay, I was right but not necessarily right about who was causing what (I was kind of right). The reasoning behind it makes sense so I am thankful for that.
Here is what I've determined. Cordova has a whitelist under /res/config.xml where URLs are whitelisted and only those URLs are the only URLs allowed outside of the application.
But, if you try to edit config.xml it will be overwritten by Meteor on build which indicates this config is governed / overwritten by Meteor.
I searched around and found a few things: Meteor / Cordova, Meteor. The second article gives the solution. You must use the package browser-policy to whitelist what URLs you want.
After installing browser-policy, you must include them in a file in /server. I tried installing them inside a if(Meteor.isServer) block outside of /server but it didn't work.
Hope this helped! I couldn't find anything similar to this and I presume others will run into this road block as well
EDIT: This will only fix it for desktop. For my issue, I had to create a top-level file called mobile-config.js and use config settings from this page to whitelist URLs. This change happened in Meteor 1.0.4
EDIT 2:
Here is it said more clearly: You must whitelist all outside URLs that you want to contact inside of mobile-config.js
For instance, if you want to contact google.com from your mobile app, you would add
App.accessRule('https://www.google.com')
Thankfully Meteor has fixed their extreme documentation issue and has now included this on the official documentation here

Build Phonegap Hydrated App Screen

I am creating a mobil project with phone gap. My project include few page tag in one index.html file. When I build my project without Hydration, all page are shown in main page on Galaxy Note 4. When I build with hydration, my project is shown normally. But when application starting, a page is showing ("Loading Hydrated Application"). I don't want to show this page. How can I close this page?
I suspect the only way to keep "Loading Hydrated Application" from showing is to build without Hydration enabled.
That being said, I had a similar problem with the PhoneGap Robot showing up on a brief splash screen as my app loaded on a mobile device. I found the image somewhere in the 'www/res/' directory and changed it to my company logo. Problem solved for me.
Perhaps there is a similar process happening for the Hydration message. Try looking in the images to see if it is there, and if so, replace it with something more appropriate.

ajax navigation error when using phonegap and ran locally

Sorry for the complete newbie question but i'm not having much luck.
I've created a project through eclipse with the phonegap plugin and deployed it as an android app onto a tablet to run locally - but I'm getting the 'Note: Navigation may not work if viewed locally' bar being added on the bottom of the pages.
How do I get round this? I thought if it was packaged up in this format I wouldn't have to install an android webserver onto the tablet and run it through the browser?
All guidance is much apreciated.
I had the samme error, and it turned out that jquery.mobile was included twice. Removal of the twin reference resulted in removal of the Note.

data-rel="external" not working in jQueryMobile Beta 2 and PhoneGap 1.0

I just upgraded to PhoneGap 1.0 and jQueryMobile Beta 2 and it seems like file:// navigation is totally borked. I've posted a super stripped-down 2 page example for Android 2.2 here: https://bitbucket.org/uhlenhuthm/pgdemo/overview
DETAILED PROBLEM DESCRIPTION:
I've created a very simple 2 page test application in PhoneGap 1.0 for Android. In my assets/www folder, I have two files: index.html and hola.html. PhoneGap loads the index.html file which contains a single button (see below). Clicking on the button SHOULD load a new page (no AJAX loading), but instead the button just changes color while being tapped and nothing else happens. This only happens when the link has data-ajax="false". Setting data-rel="external" actually has no effect and JQM loads the page using AJAX (another bug). AJAX loading works fine, but that's not what I need (for a more complex project). Including the phonegap.min.js file doesn't fix the problem either.
The weird thing is that this works in the browser (not going through PhoneGap on the phone, it goes to hola.html no problem). Maybe there's something weird with how JQM and PhoneGap deal with file:// URLs?
Am I making a bonehead mistake or is there something really wrong here?
Attempt to give this a read. He points out many different issues with upgrades, this being one of them. Here is a quote detailing what probably is causing this issue: "If you are unable to open a second html page in your app then you're missing the following tag which should be placed in the application tag of your apps AndroidManifest.xml:"
<activity android:name="com.phonegap.DroidGap" android:label="#string/app_name" android:configChanges="orientation|keyboardHidden"><intent-filter></intent-filter></activity>
I hope this helps!

Categories

Resources