Android Layout on Worklight

126 Views Asked by At

I am beginner with Worklight. I developed an android application using Estimote Android API. Now I want the same application in Worklight. What should I do to get android UI on worklight. I wrote same code on Native folder in Android environment. But I am getting blank display instead of MainActivity layout. How to display android layout on Worklight? Please help me with this issue.

1

There are 1 best solutions below

0
On

Are you aware of Worklight's client-side abilities? That is, with Worklight you can create either Hybrid apps or Native apps. Make sure to read IBM Worklight's Getting Started training materials.

  • Hybrid apps are basically a native application shell, containing a web app built using JavaScript, CSS and HTML.
  • Native apps are just that, fully native Android apps where Worklight provides an API set to work with the Worklight Server and other server-side features.

From your text, it sounds like you have opted to use the Hybrid application model, and in this case it would make perfect sense to me that your native UI code is not displayed out-of-the-box, as that would require altering the default Activity Worklight provides for the Hybrid Android application.

You do not explain what changes you have done

The default activity essentially brings up a Web View into which it loads the client framework as well as display in the index.html that can be found in your Worklight application (your project > your app > common folder > index.html).

So by just adding your code and layout, it does not mean that your app's display will change. This will require you to alter the loading sequence of the application.

You do not explain what changes you have done

In any case, it sounds to me like you need to decide whether to:

  1. Use HTML, CSS and JavaScript to build your application's UI per the Hybrid application model
  2. Create a native app instead, where you will be able to create the UI how you want to, like you say in your question
  3. Learn how to mix & match native and web UI elements together in your Hybrid Worklight application