App Widget Part 3 – CHANGING THE LAYOUT ON RESIZE – Android Studio Tutorial

In part 3 of the app widget tutorial, we will override
the onAppWidgetOptionsChanged, onDeleted, onEnabled and onDisabled callback methods, which will be triggered over broadcasts at different points of the lifecycle of our widget.
OnEnabled will be called every time we delete a widget, onEnabled will be called when we place our first widget on the home screen but not for any additional one, and onDisabled will be called when we delete our last widget from the home screen.
We will take a closer look at onAppWidgetOptionsChanged, because this method will be called when we change the size of our widget. Here we get passed 4 different width/height values, which are:
OPTION_APPWIDGET_MIN_WIDTH, OPTION_APPWIDGET_MAX_WIDTH, OPTION_APPWIDGET_MIN_HEIGHT and OPTION_APPWIDGET_MAX_HEIGHT. The min width and max height are the dp dimensions of our widget when the device is in portrait mode, and depending on their value we can change the app widget’s layout, for example by making views invisible when the available space is too small.
The same as in onUpdate we have to call updateAppWidget on the AppWidgetManager and pass an RemoteViews object to apply the changes to our widget.

Watch the whole playlist:
https://www.youtube.com/playlist?list=PLrnPJCHvNZuDCoET8jL2VK4YVRNhVEy0K

Example code:
https://codinginflow.com/tutorials/android/app-widget/part-3

______________________________
Free 7-day trial for Treehouse courses:
https://treehouse.7eer.net/c/1141770/228915/3944

Great books to learn Android development:
-The Big Nerd Ranch Guide: ➣ http://amzn.to/2jGADD6
-Head First Android Development: ➣ http://amzn.to/2jHAmQz

Best equipment for long hours of coding:
-Keyboard: ➣ http://amzn.to/2khXPvJ
-Mouse: ➣ http://amzn.to/2jFYBi7

My recording equipment:
-Microphone: ➣ http://amzn.to/2DxbW4A

Disclosure: The links marked with ➣ are affiliate links. This means I get a small compensation if you buy anything there or register for their services. This does NOT lead to any additional costs for you, but it’s a good way to support my channel 🙂

Simple App Widget – Android Studio Tutorial

In this tutorial we will learn, how to create a simple home screen app widget that contains a button and opens the MainActivity when we click it.
For this we will create a widget layout, an AppWidgetProvider class and an AppWidgetProviderInfo xml file. In the AppWidgetProvider java file we will then override onUpdate and create a PendingIntent which brings us to our MainActivity. We set this intent on our widget button with help of the RemoteViews class and then update our widget with the appWidgetManager object. We repeat this process for all instances of our widget by looping through the appWidgetIds int array.
In the app widget info xml file, we define the update frequency with updatePeriodMillis, the widgetCategory, minHeight, minWidth, minResizeWidth, initialLayout and more.
Lastly we register our AppWidgetProvider in the AndroidManifest.xml file as a broadcast receiver with the APPWIDGET_UPDATE intent filter. We register our appwidget info object in the meta data tag with android.appwidget.provider.
Our widget will have a previewImage which we create with help of the Widget Preview app and it will be resizable.

Watch the whole playlist:
https://www.youtube.com/playlist?list=PLrnPJCHvNZuDCoET8jL2VK4YVRNhVEy0K

App Widget Guidelines:
https://developer.android.com/guide/topics/appwidgets/index.html
https://developer.android.com/guide/practices/ui_guidelines/widget_design.html

Example code:
https://codinginflow.com/tutorials/android/app-widget/part-1

______________________________
Free 7-day trial for Treehouse courses:
https://treehouse.7eer.net/c/1141770/228915/3944

Great books to learn Android development:
-The Big Nerd Ranch Guide: ➣ http://amzn.to/2jGADD6
-Head First Android Development: ➣ http://amzn.to/2jHAmQz

Best equipment for long hours of coding:
-Keyboard: ➣ http://amzn.to/2khXPvJ
-Mouse: ➣ http://amzn.to/2jFYBi7

My recording equipment:
-Microphone: ➣ http://amzn.to/2DxbW4A

Disclosure: The links marked with ➣ are affiliate links. This means I get a small compensation if you buy anything there or register for their services. This does NOT lead to any additional costs for you, but it’s a good way to support my channel 🙂

Channel: Coding in Flow
Published: 2018-03-06 08:46:31
Duration: 17M26S
Views: 1104
Likes: 38
Favorites: 0

Multiple Choice Quiz App with SQLite Integration Part 1 – PREPARING THE LAYOUTS – Android Tutorial

In this video series we are going to build a multiple choice quiz app which stores it’s questions in an SQLite database. We will count points for correct answers, save a highscore and implement a countdown timer for each question. We will also display the wrong and correct answers after the user made it’s choice or the timer ran out.

In part 1 we will prepare the starting screen, the quiz activity and their corresponding layouts. We will also set up the “start quiz” button which then opens our quiz activity via an intent.

Watch the whole playlist:
https://www.youtube.com/playlist?list=PLrnPJCHvNZuDCyg4Usq2gHMzz6_CiyQO7

Example code:
https://codinginflow.com/tutorials/android/quiz-app-with-sqlite/part-1

______________________________
Free 7-day trial for Treehouse courses:
https://treehouse.7eer.net/c/1141770/228915/3944

Great books to learn Android development:
-The Big Nerd Ranch Guide: ➣ http://amzn.to/2jGADD6
-Head First Android Development: ➣ http://amzn.to/2jHAmQz

Best equipment for long hours of coding:
-Keyboard: ➣ http://amzn.to/2khXPvJ
-Mouse: ➣ http://amzn.to/2jFYBi7

My recording equipment:
-Microphone: ➣ http://amzn.to/2DxbW4A

Disclosure: The links marked with ➣ are affiliate links. This means I get a small compensation if you buy anything there or register for their services. This does NOT lead to any additional costs for you, but it’s a good way to support my channel 🙂

Channel: Coding in Flow
Published: 2018-02-12 17:39:30
Duration: 16M8S
Views: 10212
Likes: 205
Favorites: 0

How to Change the App Icon in Android Studio (With Adaptive Icons)

Adaptive icons were introduced with Android Oreo. They consist of a foreground layer and a background layer and make interesting animations and effects possible. If your app has target SDK 26 (Oreo) or higher and you don’t provide an adaptive launcher icon, newer app launchers will downscale your default icon and place it on a white background, which doesn’t look very nice.
In this video we will learn how to change the app icon in Android Studio with the Adaptive Icon Wizard, which also creates a legacy icon (needed for SDK 25 and lower).

Adaptive Icon Playground app:
https://github.com/nickbutcher/AdaptiveIconPlayground

______________________________
Free 7-day trial for Treehouse courses:
https://treehouse.7eer.net/c/1141770/228915/3944

Great books to learn Android development:
-The Big Nerd Ranch Guide: ➣ http://amzn.to/2jGADD6
-Head First Android Development: ➣ http://amzn.to/2jHAmQz

Best equipment for long hours of coding:
-Keyboard: ➣ http://amzn.to/2khXPvJ
-Mouse: ➣ http://amzn.to/2jFYBi7

My recording equipment:
-Microphone: ➣ http://amzn.to/2DxbW4A

Disclosure: The links marked with ➣ are affiliate links. This means I get a small compensation if you buy anything there or register for their services. This does NOT lead to any additional costs for you, but it’s a good way to support my channel 🙂

Channel: Coding in Flow
Published: 2017-12-29 09:36:51
Duration: 4M38S
Views: 4007
Likes: 60
Favorites: 0

Swipe Close Activity with Slidr Library – Android Studio Tutorial

In this video we will learn, how to use the Slidr library to finish an activity by swiping it off the screen.

Example code, GitHub link, instructions etc:
https://codinginflow.com/tutorials/android/slidr

______________________________
Free 7-day trial for Treehouse courses:
https://treehouse.7eer.net/c/1141770/228915/3944

Great books to learn Android development:
-The Big Nerd Ranch Guide: ➣ http://amzn.to/2jGADD6
-Head First Android Development: ➣ http://amzn.to/2jHAmQz

Best equipment for long hours of coding:
-Keyboard: ➣ http://amzn.to/2khXPvJ
-Mouse: ➣ http://amzn.to/2jFYBi7

My recording equipment:
-Microphone: ➣ http://amzn.to/2DxbW4A

Disclosure: The links marked with ➣ are affiliate links. This means I get a small compensation if you buy anything there or register for their services. This does NOT lead to any additional costs for you, but it’s a good way to support my channel 🙂

Channel: Coding in Flow
Published: 2018-04-02 14:04:15
Duration: 4M52S
Views: 1497
Likes: 55
Favorites: 0

ConstraintLayout Tutorial Part 1 – UNDERSTANDING CONSTRAINTS – Android Studio Tutorial

In this video series we are going to learn, how to use the ConstraintLayout, which is basically an improved RelativeLayout with a flatter view hirarchy, better performance and more functionality.

In this video we will learn, how to convert an existing layout into a ConstraintLayout, how to set and delete constraints, use the infer constraints and autoconnect functionality, switch between wrap_content, match_constraint and fixed size, change the margin and bias and everything else we need to get started with ConstraintLayout.

Watch the full playlist:
https://www.youtube.com/playlist?list=PLrnPJCHvNZuA80lNWNCLICR3qYzhw3iPI

______________________________
Free 7-day trial for Treehouse courses:
https://treehouse.7eer.net/c/1141770/228915/3944

Great books to learn Android development:
-The Big Nerd Ranch Guide: ➣ http://amzn.to/2jGADD6
-Head First Android Development: ➣ http://amzn.to/2jHAmQz

Best equipment for long hours of coding:
-Keyboard: ➣ http://amzn.to/2khXPvJ
-Mouse: ➣ http://amzn.to/2jFYBi7

My recording equipment:
-Microphone: ➣ http://amzn.to/2DxbW4A

Disclosure: The links marked with ➣ are affiliate links. This means I get a small compensation if you buy anything there or register for their services. This does NOT lead to any additional costs for you, but it’s a good way to support my channel 🙂

Channel: Coding in Flow
Published: 2018-02-04 11:10:18
Duration: 9M49S
Views: 3729
Likes: 71
Favorites: 0

Leave a Reply

Your email address will not be published. Required fields are marked *