Thursday, August 16, 2018

Whats new in Android Pie 9.0

                                      

A New Way to Rotate Phone
Android has come up with the latest functionality to rotate horizontally with simple tap on botton icon. Same icon can be used to rotate back to vertical


Adaptive Battery
Digital Wellbeing
Google has released a new app on play store which monitors the hours of user spending times on every app so the user can adapt the best way to use the phone.


Revamped User Interface
Google is working on introducing material design 2 usage guidelines and themes to improve the user interface

Ban Annoying Notifications

Gesture Navigation

Removes the recent apps overview button and replaces the original home button with a pill that can slide up to show recent apps or slide right to quickly switch between apps

Monday, August 6, 2018

Sunday, July 15, 2018

Top Topics to know in SWIFT




                             
Observer V/S Delegates in SWIFT


Delegates are one to one communication and whereas an observer is having one and many other places to notify that observer through the code, from many places. In Observer its quite difficult to keep the record of every notifier, timing issues and maintain code and its hard to keep record of every notifier

LifeCycle of Views



Here are the different life cycle called whenever user loads the views on screen



Automatic Reference Counting and Retain Lifecycle


Favourite Framework










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()