Thursday, May 31, 2018

Android App Bundle for bigger size APK's

The new app publishing format, the Android App Bundle, is an improved way to package your app. The Android App Bundle lets you more easily deliver a great experience in a smaller app size, allowing for the huge variety of Android devices available today. You don’t need to refactor your code to start benefiting from a smaller app.
Google Play’s new app serving model, called Dynamic Delivery, then uses your app bundle to generate and serve optimized APKs for each user’s device configuration, so they download only the code and resources they need to run your app. You no longer have to build, sign, and manage multiple APKs to support different devices, and users get smaller, more optimized downloads.

Monday, May 28, 2018

Flutter App for Android and iOS(Flutter Development)

To begin developing the apps using flutter, please have look into the following steps

  • Install the flutter plugin from Android Studio Preference > Plugins > Search key "Flutter"
  • Restart the Android Studio after successful install
  • To start developing the Complete Flutter app, download the flutter SDK
  • To download the flutter SDK click on new flutter project > Dropdown option to Install SDK
  • Choose the directory where you want to install SDK, wait until it installs.
  • Click finish >








Thursday, May 10, 2018

Android Jetpack

                   

         


Google has announced the Android Jetpack in May 2018  to accelerate the mobile app development.
Android Jetpack is the next generation of android components, with the help of support library.
backwards compatibility and immediate updates -- to a larger set of components, making it quick and easy to build robust, high quality apps.

What jetpack does
see the pic


Android Jetpack Components includes
  • Work Manager
  • Paging
  • Navigation
  • Slices

Android jetpack designed to work well with Kotlin, saving you even more code with Android KTX. 
Key area's of architecture component of jet pack



Each of these jetpack components is individually adaptable and they built to work well together.

Next is architecture component which is designed such way to resolve the developer pain point, some of them like lifecycle management, data persistence.
                  


Three new architecture component is seen below image


  

Paging facilitates gradual on-demand data loading from local or network data source allowing apps to work with large datasets including support recycler view.





Navigation provides the framework to build app flows that compile with android design guidelines with proper behavior for up and back button.

 Support for
  1. Deep linking 
  2. Automated fragment transactions
  3. Overflow Menu
  4. Navigation Drawer
  5. Bottom Navigation show in above pic
This is combined with the powerful graphical editor included 
In Android studio Navigation allows us to visualize, design and test app navigation graph
shown below pic



  





Work Manager makes it easy to schedule one-off or periodic asynchronous tasks.
Tasks can executes in order, Parallel or even more configurations.


Its also easy to query for the state of tasks and constraints, such as requiring unneeded network or charging Perhaps most importantly work manager takes care of compatibility issues, so you know that no matter what platform the user is on tasks are scheduled efficiently and system wide health in mind 

shown pic below





UI layer includes 

  1. Animaton & transitions 
  2. Layout
  3. Emoji
  4. Fragments
  5. TV library 
  6. Wear library 
  7. Auto library  are now the part of Jetpack
    Shown pic below








                                         










Behavior includes support for evolving android areas 

  1. App notifications
  2. Permissions
  3. Sharing
  4. Slices

Jetpack adds supports Slices, which allows your app to exposed templatized pieces of itself  to integrate with other apps such as Google search and assistant
shown pic below





Foundation includes

  1. Appcompat 
  2. Libraries for automated testing 
  3. And new ANdroid KTX Kotlin extensions

    Which makes Android development with Kotlin more concise, idiomatic and modern









credit src: https://www.youtube.com/watch?v=r8U5Rtcr5UU&index=1&list=PLWz5rJ2EKKc9mxIBd0DRw9gwXuQshgmn2

Android KTX



How to migrate existing java files to Kotlin ?

Here are the steps


  1. Android Studio Menu -> Code -> Convert Java File to Kotlin FileHere is how the functions appears once you convert Java
  2. For Threads & Handler make sure you use inner classes instead function because Kotlin throw a warning saying handler leak,


     

  3. Here is the example code how to use the Handler and thread

    var mIncomingHandler = Handler(IncomingHandlerCallback())

    internal inner class IncomingHandlerCallback : Handler.Callback {
    
        override fun handleMessage(message: Message): Boolean {
    
            swipe_refresh_layout.isRefreshing = false        if (message.what == GetCountryFactsThread.GETCOUNTRYFACTSTHREAD_SUCCESS) {
                val countryFactRespo = message.obj as String
                mCountryModel = ResponseManager.parseCountryFactsRespo(countryFactRespo)
    
                updateAdp(mCountryModel!!)
    
            } else if (message.what == GetCountryFactsThread.GETCOUNTRYFACTSTHREAD_FAIL) {
                //Write code handle if any session expiry            showSnackBar(resources.getString(R.string.no_internet))
            }
            return true    }
    }


    You can call it as below inside the onCreate method of activity

    GetCountryFactsThread(this, mIncomingHandler).start()











Google I/O 2018 Updates



                 Here are the Day 1 key highlights of Google I/O 2018   

*Waymo wants to make self-driving future a reality for everyone. Waymo cars have covered 6 million miles on public roads so far and have done over 5 billion miles in simulation.

* Big push for Google Lens. Google Lens will now be integrated into the Maps app, starting next week. It can now recognize and understand words. You can point your camera to an object and search for quick results. You can even search for those objects on e-commerce stores and buy them directly from Google Lens.

*Google Maps will now use VPS- Visual Positioning System to show exact directions. You can use the camera within Google Maps to get exact directions and landmarks.

*AI will be at the core of Google Maps now. A new tab called "For You" is being added to Maps. It will show recommendations of cafes, restaurants in the nearby areas. A new Group Planning feature on Maps will allow people to suggest and vote on a dinner location without having to leave the Maps app

*Android P Beta announced. Will available from May 8.

* Android P will set time limits to apps and will suggest you to take breaks from your mobile. A new Do Not Disturb mode will keep away all distractions- notifications, vibrations, etc. YouTube will have a deep link which will tell you the total watch time across mobile and desktop. Also, people have a habit to spend hours on the mobile right before bed. A new Wind Down mode will help users sleep better.

*Android P will have a digital well-being feature via Android dashboard. This will give insights on:
How many times you have unlocked?
How many notification have you received?
How much time have you spent on a particular app?
*Auto-rotate is now improved. A new rotation icon will popup beside the navigation icons to let you choose whether you want to actually rotate the screen or not for apps which are otherwise always used on portrait mode like Gmail. This will prevent accidental auto-rotate, which is frustrating sometimes.

*Google announces ML Kit for developers who are not much proficient on machine learning. The ML Kit will offer image, text, barcode and face recognition among others. There's a new system navigation. It is more gesture based natively.

*Android P is the first version of Android to highlight and pay attention digital well-being. Android P is all about simplicity,intelligence and digital well-being. It will leverage machine learning and artificial intelligence to take care of obvious settings on the phone like App prediction, adaptive brightness, adaptive battery and more.
*World's most popular operating system-- Android-- turns 10.

*The new Google News is here. You will get a briefing of the top five stories along with latest local stories. Google News will use machine learning to understand your news preference and will show stories accordingly. There is a new feature called 'Full Coverage'. This will show all relevant stories on a particular story from different sources. Also, ' Subscribe will Google' will allow you to access your paid content everywhere on Google's platform.

* Android dashboard will take care of digital well-being. It will understand your habits, focus on what matters and will tell you to switch-off apps and spend time with family. For example, if you watch too much of YouTube or any other app, the Android dashboard will suggest you to take a break and talk to your family or friends.

Post credit : www.gadgetsnow.com