As I understand it, you have a web app (HTML + CSS + JavaScript) to use as a Android App Widget .
For this, you will need to load your application using a WebView
.
According to the official App Widgets guide :
Creating the App Widget layout is simple if you're familiar with
Layouts. However, you should be aware that App Widget layouts are based
on RemoteViews, which do not support every kind of layout or view
widget.
A RemoteViews object (and, consequently, an App Widget) can support
the following layout classes:
- FrameLayout
- LinearLayout
- RelativeLayout
- GridLayout
And the following
widget classes:
- AnalogClock
- Button
- Chronometer
- ImageButton
- ImageView
- ProgressBar
- TextView
- ViewFlipper
- ListView
- GridView
- StackView
- AdapterViewFlipper
Descendants of these classes are not supported.
What a summary in English means: WebView can not be used in App Widgets .
Well, theoretically it can not. It looks like someone from the
MacGyver , called
Mike M. has figured out a way to do
WebView work in App Widget .
It involves loading a WebView
on the outside, rendering the content as a bitmap, and using ImageView
to display this image.
I do not recommend using this method if the application needs to do some advanced user interaction. In theory there is no way to interact with buttons, or any other gadget in your web app . Because nobody keeps you from re-creating the tag map in your app, but I'll let you know , this is masochism.