askIT

Android Howto create a Widget

save.png Download source code howto_create_a_widget

This tutorial will show how to create a simple Widget.


Step 1. Create new project

Create a New project in Android Studio.

new_project_howto_create_a_widget.png
Fig: New project

Set target android devices to Phone and tablet Api 24: Android 7.0.

android7.png
Fig: Minimum SDK Android 7

Click next until your project is created.


Step 2. Create new widget

Right click your res directory. Select
New -> Widget -> App Widget.

new_widget.png
Fig: New widget

widget_config.png
Fig: New widget


Step 3. Run it

Now hit run to start your widget!

widgetadd.png
Fig: Add widget to home screen in emulator

widget.png
Fig: Widget on home screen

Add comment

avatar_blank_60.png

Comment:

Name:

Email:

Comments

No comments yet. You can be the first one to comment. Just write your comment in the form and click on the submit button.