{"id":15018537,"url":"https://github.com/nativescript/sample-android-widgets","last_synced_at":"2025-10-19T16:31:23.282Z","repository":{"id":54794007,"uuid":"58116347","full_name":"NativeScript/sample-Android-Widgets","owner":"NativeScript","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-28T20:27:02.000Z","size":13427,"stargazers_count":29,"open_issues_count":2,"forks_count":10,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-10-29T16:58:19.400Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NativeScript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-05T08:31:30.000Z","updated_at":"2023-02-01T04:19:44.000Z","dependencies_parsed_at":"2022-08-14T03:10:14.105Z","dependency_job_id":null,"html_url":"https://github.com/NativeScript/sample-Android-Widgets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fsample-Android-Widgets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fsample-Android-Widgets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fsample-Android-Widgets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fsample-Android-Widgets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NativeScript","download_url":"https://codeload.github.com/NativeScript/sample-Android-Widgets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237163279,"owners_count":19265245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T19:52:05.327Z","updated_at":"2025-10-19T16:31:17.735Z","avatar_url":"https://github.com/NativeScript.png","language":"JavaScript","readme":"# Steps to create an [Android App Widget](http://developer.android.com/guide/topics/appwidgets/index.html#MetaData) in NativeScript\n\n* Create an android layout for your widget and place it in `platforms/android/src/main/res/layout`. Make sure to follow the [official guidelines](http://developer.android.com/guide/practices/ui_guidelines/widget_design.html) as not all views are supported.\n* Create a [widget meta-data](http://developer.android.com/guide/topics/appwidgets/index.html#MetaData) file and place it in `app/App_Resources/Android/xml/`.\n* [Extend](./app/myWidgetClass.js)  `android.appwidget.AppWidgetProvider` and implement its `onUpdate` method. For more information on how to do it refer to the [Android API Guides](http://developer.android.com/guide/topics/appwidgets/index.html#collection_sample).\n* Update the [AndroidManifest.xml](https://github.com/Pip3r4o/ns-androidWidget-App-Demo/blob/master/platforms/android/src/main/AndroidManifest.xml#L40) 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. \n\n\u003e**Note:** A full widget class name is only considered valid when it contains package descriptor eg. `com.tns` or `a.b` in the front.\n\n# How to run\n\n* Run command in your terminal\n```Shell\ntns run android\n```\n* Add the widget from the application WidgetDemo to your home screen. \n* 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.\n\n# Preview\n![Widget demo](widget.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript%2Fsample-android-widgets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnativescript%2Fsample-android-widgets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript%2Fsample-android-widgets/lists"}