No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
app initial commit May 4, 2016
.gitignore removed platforms/ node_modules/ and updated .gitignore May 9, 2016 update README May 9, 2016
package-lock.json chore: update to 3.4.0 Jan 29, 2018
package.json chore: update to 3.4.0 Jan 29, 2018
widget.png update README May 4, 2016

Steps to create an Android App Widget in NativeScript

  • Create an android layout for your widget and place it in platforms/android/src/main/res/layout. Make sure to follow the official guidelines as not all views are supported.
  • Create a widget meta-data file and place it in app/App_Resources/Android/xml/.
  • Extend android.appwidget.AppWidgetProvider and implement its onUpdate method. For more information on how to do it refer to the Android API Guides.
  • Update the AndroidManifest.xml located in app/App_Resources/Android and register your widget, where receiver android:name=??? contains the full widget class name, and meta-data android:resource=@xml/??? - your widget meta-data.

Note: A full widget class name is only considered valid when it contains package descriptor eg. com.tns or a.b in the front.

How to run

  • Run command in your terminal
tns run android
  • Add the widget from the application WidgetDemo to your home screen.
  • Clicking on the button on the right will increase the tap counter, while clicking on the image will open the application with which the widget is associated.


Widget demo