Today i encountered this question What kind of XmlConverter can I use for Retrofit in Android?
When looking for a problem i'm having, and i wondered if there are any new xml conversion library that i can use with retrofit in android.
As it is an old question ( four years ago ) it might have a new answer nowadays!
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I'm building an app and I need to use a database in it. I'm considering using Room as it's new and hot right now. But I've heard a lot of great stuff about Realm too. Can someone point out the possible advantages of using each?
I did my research and read the docs but I have no experience to understand it myself
Room docs
Realm docs
EDIT:
It's been some time and and I can point out another reason to use Room. Although you can use Realm and Transformations to tie things up with LiveData but with Room you can directly return LiveData (and also RXJava types using a plugin) for the DB, which will save you some boilerplate code and headache.
EDIT 2:
In addition to the first edit, Room now has a first class support for coroutines in Kotlin so if you are planning to use those it will be a nice-have -> https://medium.com/androiddevelopers/room-coroutines-422b786dc4c5
Realm
A relatively fast and convenient library, all links are simply implemented, which is related to the object orientation of the database. Excellent documentation. Is, perhaps, one of the best option for storing data on a mobile device at the moment, the minus can only be an increase in the size of the apk-file by 2.5 MB.
Room
An interesting solution presented on Google I / O 2017 as optimal for working with the database on Android OS. Despite the fact that it is necessary to use explicit sql-requests, the library turned out to be quite convenient and I liked it personally. On performance is in the lead, so I would advise you to choose this particular library. Big advantage of this is based on build-in SQLite database. Since this solution, submitted by Google, it will quickly become popular, and, therefore, there will be no problems with finding solutions to problems that occur along with it.
Realm uses more RAM and increases the apk size, build time. So I prefer Room.
There are comparison: https://github.com/AlexeyZatsepin/Android-ORM-benchmark
The main reason that we pushed to use a library for database is the fact that it let us model our objects and made CRUD easier, I had a good experience with Realm, it's really easy to set up and work, it's fast and flexible, but size of the library was an issue, it's possible to reduce APK size by splitting APKs on build target ABI but I preferred to use GreenDao because it's based on SQLite, although I think it has some disadvantages like any other libraries but it was the best option for me.
Honestly, I didn't try Room yet but with a brief look at the documents you will find it more flexible and friendly to developers, As a Google fan, I prefer to use Google guys' library! As I said before I prefer a layer over native SQLite to a whole new database library.
I will try Room in my next project and share my experience here in an update later, hope it helps.
I have used retrofit-robospice module in my previous project, it uses retrofit 1.6 .
with the new version of retrofit (retrofit 2), I want to rewrite that module with retrofit 2 . I have heard from some programmers that there is no need to use robospice anymore and you can just use retrofit 2 itself .
the reasons that I use robospice :
Listeners
Configuration Change Managment
async requests
caching
no memory leaks
so my question is do you recommend using retrofit-robospice module ?
if yes in which scenarios ?
and does it worth rewriting that module for retrofit 2 ?
IMHO. What you asking here is a subjective opinion of different people. Everyone will just say to use or not to use a retrofit-module. So i'll just be like others. In my experience robospice-retrofit makes an excellent job, and i definitely recommend to use it and i'm using it myself. But again it's just another opinion of another person.
If you're already asking this question then it must be that the scenarios of using Robospice you've got figured out yourself until now. Why would you ask if that's not true. There's an excellent infographics which illustrates the usage better than any words.
And the last one about does it worth to rewrite the module or not. The answer is: "Yes, it is worth the effort". The library itself is an open source project with the code base located on GitHub. Not to mention that by 'rewriting' the module one would save the others from asking that same question again in the future. So instead of asking somebody else to do the work and give it on the silver plate everyone may just do the work by himself and share his work with others. And after that one would be able to tell us was it worth to rewrite the retrofit Robospice module or not.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I am confused the which one good for android perspective either Ormlite or sqlite.
please can you give me suggestion which one is better for use our android app. And makes easy to use and supported all android devices?
I want to use the ormlite in our project but before i want to sure that it will be helfull for me and my app. So please guide me if any one used earlier this. I much appreciate your thought here.Thnaks
ORMLite is an open source software framework that provides lightweight object relational mapping (ORM) between Java classes and SQL databases.
if you use this framework you are ultimately using sqlite database (ORMLite is no database),it allows you to implemet a good architecture to your application, I always prefer using ORMLite
Here is my blog on ORMLite if you want to get started with it!!
ORMLite has two .jar files : ormlite-core.jar (275KB) and ormlite-android (50KB) libraries
Advantages :-
Use for complicated database operations
No need to remember to SQL queries
Prefer for big size application
Disadvantages :-
Unnecessarily increase size of application
Little bit slow with compare to greenDao(another ORM)
Although other answers are perfect but I want to mention another aspect about using ORMs such as Ormlite vs SQlite.
ORMs (such as Ormlite) are good to use because they reduce amount of work and code but I've read this and I mention the opinion here:
We generally do not recommend using an Object-Relation Mapping library
unless you have unusually complex data and you have a dire need. They
tend to be complex and require time to learn. If you decide to go with
an ORM you should pay attention to whether or not it is process safe
if your application requires it, as many of the existing ORM solutions
surprisingly are not.
You can also choose to look at Storm (https://github.com/supaldubey/storm/)
It provides neat interface and does not asks to override or implement any base classes for the Models.
It also would auto create and auto upgrade your models
You can add to Gradle and start using easily
In parent:
maven { url "http://dl.bintray.com/cubestack/maven" }
In project Gradle:
dependencies {
compile 'in.cubestack.android.lib:storm:1.0g'
}
Step 1: Define tables:
#Table(name = "DEMO_ENTITY")
class Entity {
#PrimaryKey
#Column(name="ID", type = FieldType.INTEGER)
private int id;
}
Step Two (Define the Database)
Database also have their annotation which can be applied, there can be multiple databases defined.
#Database(name="MY_DB", tables = {Entity.class, AnotherEntity.class}, version = 2)
class Database {}
Step Three (Start Using)
With database ready for us, we may start using it as below:
Retrieval
StormService service = new BaseService(getContext(), Database.class);
List<Entity> savedEntities = service.findAll(Entity.class);
Similarly it has methods to save, delete etc.
This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Android FTP Library
Can anyone provide me a fully working code for a FTP Client for Android?
After searching I have found that there is no built in library for Android FTP.
I would suggest looking through open source repositories to give you a head start, which I assume you're looking forward.
Here's one I found in about a minute of searching https://github.com/samterer/AndroidFTP. Looking at the implementation it looks like its in working condition but I have no idea really. I'll leave that up to you. Be sure to give credit where credit is due in your work.
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
moving to android from j2me
shall we reuse the j2me source code for android application.i have the j2me source code.is this easy to convert the j2me code to android code
Hi You can fed your J2ME code and get android apk
Refer this url
http://www.netmite.com/android/srv/2.0/getapk.php
See this for an answer: Android and J2ME
There also exists automatic conversion service - http://upontek.com/J2MEtoAndroidServices.php you may want to try