I built a JAVA
application for personal use, that makes the persistence with JPA
and EclipseLink
.
I'm making a equal for android
. I would like to synchronize data via Dropbox
.
Is there JPA and EclipseLink for android? I have not found anything about this.
What alternarivas there?
-
I add the use of the application, I do not know if it provides something. It is to take "notes" that are important to me and store them encrypted. and be able to see them from the computer and phone. – user60108 Jan 18 '13 at 17:53
2 Answers
You can run almost anything which is pura java on android (with some minor exclusions ), but this does not mean that you should. Hibernate ( which is implementing JPA ) can be run on android, but your application willbe too heavy. Your handset is not heavy server system.
I would propose to store data locally serialized to JSON and exchange JSON data files via dropbox ( but of course I do not know anything about your use case to make better proposals )

- 12,329
- 1
- 30
- 35
JPA implementations such as EclispeLink and Hibernate are too heavy for android. There are some light-weight ORM tools, but they are not implementing JPA specification. Cmobilecom JPA is a new light-weight JPA implementation for both Java and Android. Its size is about 380K.
If you want to migrate your java application to android, simply add the following gradle dependencies to your project:
Android:
dependencies {
implementation("com.cmobilecom:cmobilecom-jpa-android:${version}@aar") {
transitive = true
}
annotationProcessor "com.cmobilecom:cmobilecom-jpa-processor:$version"
}
You can use Cmobilecom JPA for java applications or server side (JDBC) too:
dependencies {
implementation "com.cmobilecom:cmobilecom-jpa-jdbc:$version"
// annotation processor: generate static metamodel
compileOnly "com.cmobilecom:cmobilecom-jpa-processor:$version"
}
Disclaimer: I am a developer of Cmobilecom JPA.

- 363
- 1
- 6