IBM Worklight 6.0 - Unable to run sample hybrid worklight app using dojo toolkit for android environment on avd?
Let's back up just a bit.
In nsand's post in regard to the Console View, what he was trying to determine is if your application is using the new Dojo Library Server that was introduced in 6.0. In short, for 6.0, your application only has within it Dojo Mobile Layers. Any other resources it needs, e.g. translations, dijit widgets, are being served from the server. You can read about it in the 6.0 Information Center: http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/index.jsp?topic=%2Fcom.ibm.rad.worklight.doc%2Ftopics%2Fcdojolibprjsetupwl.html
If you follow nsand's steps for unchecking Provide Library Resources, this turns off your application's access to the Dojo Library/Server. All of its Dojo needs must be handled by the Dojo Mobile layers, or you had to have copied the needed resources into the project.
So
Step 1: Verify your application works in the Mobile Browser Simulator with Provide Library Resources checked. If the Console log is showing resources being served from the server, then these have to be copied to your application before deploying to AVD or a device
Step 2: After you think you have all Dojo/resources within your project, uncheck Provide Library Resources and test it again in MBS. If it fails in MBS, then something is missing in your application that is in the library/server. You can check Provide Library Resources and retest to see if it shows you what that is. Not all resources are shown, e.g. if there's a missing CSS file.
Let us know if that helps you find the problem. If you uncheck Provide Library Resources and it works fine in MBS but fails on the device, then we need to look elsewhere.
(note: there is a defect that prevents you from using the Dojo Library/Server with AVD or on your device. This will be fixed soon. None the less, using the Dojo Library/Server is a development time concept. Before you move to production, you app needs access to all of the necessary resources w/o them being served from the Dojo Library/Server in Studio).
IBM Worklight 6.0 - Hybrid Android Application not working in Emulator and Device
I have found out the Solution.Initially i have added all Dojo library folder to my project www folder that makes my hybrid application hangs.
What i did is i have removed all the Dojo folder from my Worklight application www folder and added only the required dojo files to my project www folder.
You can check the missing library files by opening the Console view (Window > Show View > Other... > Console). From the Console view, click the Open Console button and choose Dojo Library Requests from the list. From the Dojo Library Requests console, click the View Menu (the triangle in the toolbar), and uncheck Provide Library Resources.
Now Run you hybrid application to see all your missing Library Resources.
IBM Worklight 6.0 - scriptError in dojo.js:21
See if any of the following answers to questions about the same issue help you out:
- IBM Worklight 6.0 - Unable to run sample hybrid worklight app using dojo toolkit for android environment on avd?
- Worklight core-web-layer.js errors
IBM Worklight 6.0 - How to include Dojo patch with pre-built Dojo layers?
I have used monkey patching to accomplish what you are trying to do.
require(['dojox/mobile/css3'], function(css3) {
css3.prototype.name = function(p, hyphen) {
// put your patched version of the function here.
};
});
You will need to make sure this code gets executed before any code that needs to use the patched version gets called.
You will also be copying code from the original function. Every time you upgrade Dojo or Worklight, you will need to evaluate whether the patch is still required or if the patch needs to be modified because of changes made to the original function that may not be part of the patch.
http://en.wikipedia.org/wiki/Monkey_patch
Is "monkey patching" really that bad?
Related Topics
Android - Way to Appear Bordered Text on the Textview
How to Update UI from Asynctask
App Getting Stuck with E/Com.Facebook.Internal.Attributionidentifiers
Handle a View Visibility Change Without Overriding the View
How to Find the Android Version Name Programmatically
Android: How to Get Current Opened Application Name on Screen
Google Play Services Out of Date. Requires 11011000 But Found 10289574
Implement Double Click for Button in Android
How to Disable Crashlytics During Development
How to Launch an Activity Without a Ui
How to Provide Different Android App Icons for Different Gradle Buildtypes
Android: Why Must Use Getbasecontext() Instead of This
Cannot Find Zip-Align When Publishing App
Okhttp Response Callbacks on the Main Thread
How to Pass Parameters to Onclicklistener