Profile cover photo
Profile photo
Alexandr Crospenko
19 followers
19 followers
About
Posts

Post has attachment

Post has attachment
Add a comment...

I am creating app that should have offline mode, so previously downloaded data should stored somewhere, the most common way is to store data in SQLite database.

Mostly SQLite database is used with Content Provider in android. I have clear understanding what is the purpose of content provider (to share data between different apps), but in my case application will never need to share the data with other apps in the system.

Content provider has the similar interface as HTTP request (GET,POST,PUT,DELETE).
My idea is to create facade class which can be used like this getAllLatestNews(); firstly it will try to get latest data from the internet, if it fails - data from database will be used and if request is successful it also will save retrieved data to the database. This class will be facade for separating different layers of application (not to make requests from activities directly).

But now I am a little bit puzzled deciding whenever I need Content Provider or not. I can use SQLiteOpenHelper classes to retrieve and save data to the database or even use ORM library to do this.
At first I wanted to implement REST API Pattern B by Virgil Dobjanschi. But now I am not sure about this, maybe it would be better to create facade for Robospice(in my case, network request in the service) requests and do persistence there ?

Please share you thoughts about this topic, I would be grateful for any help.

I asked this question because I feel that it is not good practice to make requests directly from activities even if they are made in service under the hood, I want to separate different layers of my application in order to make it more flexible and maintainable.

Also my app data (in db or anywhere) should be private, but if I will create content provider any app can access my database if it knows URI , am I right , it seems to be security issue in my app ?

Post has shared content
Add a comment...

Post has attachment
Add a comment...

Hi everyone, I am here to get advice from more experienced developers than I am.   
I am developing native client for online store. I have already online shop running on OpenCart CMS.   
I have written REST API for retrieving data about products, sales and other stuff which doesn't require authentification using simple GET requests. There is nothing difficult hear.   
But I am really perplexed about Authentification and logging in user. 
I have read a lot about this, but in result I haven't found some commonly used approach to authentificate user from native clients. Of course this depends on server side rules, but in my case server side can be changed in any way that is the most suitable and secure for mobile devices.    
There several ways to do authentification I have found. Using simple web view or starting browser to authentificate user in common way and get response from web view.
Another approach is to use Oauth, but in this case I  have to open Web Browser again. 
Another way is to build private/public key with https connection, but do this directly from the app.
I need to authentifacate users in order to allow them make orders from native client. 
Maybe there are other ways to do this and some libraries to make this process easier.
Please suggest what way is more convinient and secure for mobile clients. 
Thx.

Post has attachment
Hi. I have one question about activities and fragments. What would you do in this case. And what is better to use. Here is my question and description of the problem.
http://stackoverflow.com/questions/30415538/nested-fragments-bad-practice  I can't decide for myself what to use.

Post has attachment

Post has attachment
Add a comment...

Post has attachment
Add a comment...
Wait while more posts are being loaded