Posts

Debug Database in Android

Image
In my last tutorial, we have learned how we can use persistence database in android. We also understood which database wrapper we can use in our application. Its all depend on our application that how frequently communicating with the database. If my application is a big usage of the database for online and offline sync then I would recommend using Green Dao ORM otherwise we can use Android Active ORM for a small application. Here are the link detail for GreenDao Fast ORM in Android and Active Android ORM in android.

Now, this tutorial is based on an android database. Many of android developer asked about how to debug our database if the application running on my emulator. To debug database there are many ways you can, But some of the very strong pattern we can debug the database of my application.

1. Sqlite3 by using ADB: 

There is a command line version of sqlite3 available that allow you to directly access, view and modify SQLite Database in the ADB root shell on the Android device wi…

MVVM with RxJava in Android

Image
In my last tutorial, we have learned the MVP design pattern which is most popular to used to build any android application. In that article, we had practiced building an application by using RxJava in MVP design pattern. If you are not checked my last articled which is based on MVP design pattern then I would recommend checking this here MVP with RxJava in android. Wow, that's great.

Today We got one more day lets make this day more awesome to learn something new. In this article, we will learn one more design pattern which comes from data binding in android that is called MVVM (Model View ViewModel). Model view ViewModel is similar like MVP.


Here we need to understand the what are the aspects in this diagram. Let me explain one by one.

Model: Model represents the classes that used for creating the business model of an application. It means how the data can manipulate.

View: View represents the user interface means Button or TextView. View display the data from the model.The view whi…

Runtime permission in Android

Image
In my last tutorial, We had practiced awesome features of RxJava in Android. Here are the link details RxJava in android part1, RxJava in android part2and MVP with RxJava.

Today we got one more day to learn something more. Let's make this day more awesome to learn something new. In this article, we will learn why runtime permission and how to give permission at runtime in the application. Earlier we have practiced that the user can be seen the permission detail at while installing the app. But in marshmallow device version 6.0 it has changed. Now application will not be granted the permission while installing the application. It will ask users at runtime. Why this is required? 

In the previous below the marshmallow versions like the lollipop and other lower version devices, User was felt like obvious to see the permission details while installing that, They might be thinking that why can I shared my confidential information without asking that permission. The application should be a…

MVP with RxJava in Android

Image
In my last tutorial, I have written many articles to use RxJava in android. RxJava is really very hot into the market today and many developers are using reactive functionality in our applications. It provides much more features to build the awesome app. The basic of RxJava I have already explained in my earlier articles. If you have not checked before then please go ahead and check all my posted article about RxJava in Android. Here are details link RxJava in Android part1 and RxJava in Android part2.

In this article, We will learn how to build the android app by using RxJava and MVP. MVP stand for Model View Presenter. MVP is very popular design pattern in android. Prior we practiced old design pattern name MVC (Moel View Controller). Now many of developers they are using MVP.

Let's discuss Why MVP ? and Why not MVC?

Here is the diagram that represents the MVC and MVP design pattern.



So Here are different - different aspect used in the design pattern. First, we need to know What is…

RxBinding with RxJava in android

Image
In my last tutorials, I have marked about how RxJava is working with the RxAndroid world. We understood what is Rx does? In the Rx world, it means Reactive Extension it means when anything changes it will react something. It is strongly follows the observer pattern. If you want to check What is Observable and How Observer gets notify once you anything changes in Observable Object. I would strongly recommend please check this links RxJava in Android part1 and RxJava in Android part2.
Now In RxWorld, the new terminology comes RxBinding. What is RxBinding? It is mapping an Observable to Android events (view, click) very strongly. I have marked that in the old pattern we have used many callback and listener. It is very difficult to understand for any new developer and it does not give any proper Architecture of our project. It makes always confusion to the developer to maintain the callback. It really makes our life hell. 
RxBinding will give the best Rx Architecture and makes your code str…

ActiveAndroid ORM in android

Image
In this article, I am focusing about the ActiveAdroid Orm database in Android. I have already discussed with GreenDAO fast ORM in android. If you still not checked then please check this link GreenDao fast ORM in android. Yes, this is really fast no doubt but this is required to used when we required a large amount of data to store into the database for offline and sync with online. I would be recommended to use this powerful ORM.

Now we need an SQLite database for a small application I would say to use the ActiveAndroid ORM.
This is pretty easy to add in any application and configuration is also very simple. Now the question is why ORM and this kind of wrapper if already having android SQLite database and SQL query? I would say now the time is an object oriented based concept. ActiveAndroid ORM is object relation mapping concept. It is very easy to understand and does not require any complex SQL query if you want any data from the table.

ActiveAndroid wrapper provides Object-Relational …

Content Provider in Android

Image
In my last tutorial, I have discussed the service that is the most important component in android. I would be recommended to you, please check all post related android services. Here are the details of link Service in Android Part1Service in Android Part2 and Service in Android Part3.

Now In this article, I am focusing on the share the content from different -2 ways. We will check that how many ways we can share the content to multiple apps. What are the best procedure and which is most recommended by android?

Ok, Let's see how many ways we can share the data from an app to multiple apps. Actually, you can share the content many ways but some of all are not recommended by an android framework.

1. Share the shared preference to other apps.
2. Share the SQLite database to other apps.
3. Share the internal storage files
4. Share data with content provider (recommended)
5. Share data by AIDL service
6. Share data by TCP/IP or HTTP network communication.

I have pointed some of the mechanism t…