Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] on Android(Can CDO run on Android ?)
[CDO] on Android [message #937324] Mon, 08 October 2012 22:14 Go to next message
Michele Preti is currently offline Michele PretiFriend
Messages: 14
Registered: October 2012
Junior Member
Hi all,

in a nutshell : can CDO (EMF and all requirements) work on an android device ?

i'm writing a Enterprise Resource Planning Software, and for data management i'm using JPA and Hibernate.

I already hate JPA....
But the real reason is that i've the need to write an android application that can work with a subset, for now, of the main software data.

I have already thought to write a sync process myself (bi-directional) but...it's a mess (and i'm not sure to be experienced enough to succeed).

I come across CDO project, and i like the concept (even if to me it seem it rely too much on the store implementation, especially for the CDOQuery stuff, but not really a problem)

After this introduction, i need to run the model on the main software (and this is not a problem)
and a Clone server (for offline replication) and client on the android device.

Thanks to all in advance.

[Updated on: Mon, 08 October 2012 22:15]

Report message to a moderator

Re: [CDO] on Android [message #937725 is a reply to message #937324] Tue, 09 October 2012 07:59 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 09.10.2012 00:14, schrieb Michele Preti:
> Hi all,
> in a nutshell : can CDO (EMF and all requirements) work on an android device ?
>
> i'm writing a Enterprise Resource Planning Software, and for data management i'm using JPA and Hibernate.
>
> I already hate JPA....
> But the real reason is that i've the need to write an android application that can work with a subset, for now, of the
> main software data.
>
> I have already thought to write a sync process myself (bi-directional) but...it's a mess (and i'm not sure to be
> experienced enough to succeed).
>
> I come across CDO project, and i like the concept (even if to me it seem it rely too much on the store implementation,
> especially for the CDOQuery stuff, but not really a problem)
>
> After this introduction, i need to run the model on the main software (and this is not a problem)
> and a Clone server and client on the android device.
I have absolutely no experience with Android, so you must hope that others share their thoughts, if any.

It strikes me though that an offline clone server (which constantly tries to replicate as much of the entire history as
possible) is quite heavy for a mobile device, but who knows...

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] on Android [message #937736 is a reply to message #937725] Tue, 09 October 2012 08:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Michele,
Not sure if you want to develop a native android app or a html5 application.

In any case this maybe of interest for you:
http://martintaal.wordpress.com/2012/04/05/emf-texo-json-rest-web-service-support-connecting-your-client-to-an-emf-supporting-web-server/

and I did a small demo of a html5 mobile app getting some data from an EMF generated web server at Eclipse Day Delft 2012:
http://swerl.tudelft.nl/twiki/pub/MichaelaGreiler/WebHome/Texo-EclipseDay-2012.pdf


for more information see here:
http://wiki.eclipse.org/Texo

or check out this video:
http://www.youtube.com/watch?v=D0oO4gw-gLI

gr. Martin


On 10/09/2012 09:59 AM, Eike Stepper wrote:
> Am 09.10.2012 00:14, schrieb Michele Preti:
>> Hi all,
>> in a nutshell : can CDO (EMF and all requirements) work on an android device ?
>>
>> i'm writing a Enterprise Resource Planning Software, and for data management i'm using JPA and Hibernate.
>>
>> I already hate JPA....
>> But the real reason is that i've the need to write an android application that can work with a subset, for now, of the
>> main software data.
>>
>> I have already thought to write a sync process myself (bi-directional) but...it's a mess (and i'm not sure to be
>> experienced enough to succeed).
>>
>> I come across CDO project, and i like the concept (even if to me it seem it rely too much on the store implementation,
>> especially for the CDOQuery stuff, but not really a problem)
>>
>> After this introduction, i need to run the model on the main software (and this is not a problem)
>> and a Clone server and client on the android device.
> I have absolutely no experience with Android, so you must hope that others share their thoughts, if any.
>
> It strikes me though that an offline clone server (which constantly tries to replicate as much of the entire history as
> possible) is quite heavy for a mobile device, but who knows...
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [CDO] on Android [message #938047 is a reply to message #937736] Tue, 09 October 2012 13:58 Go to previous messageGo to next message
Michele Preti is currently offline Michele PretiFriend
Messages: 14
Registered: October 2012
Junior Member
thank you for the reply

Quote:
It strikes me though that an offline clone server is quite heavy for a mobile device, but who knows...

I don't need the history, so i was planing to disable audits and keep just the last version of the object. Even so you think it's too heavy?
Do it make sense use CDO for a mobile app or is it an overkill?

Quote:
Not sure if you want to develop a native android app or a html5 application.

I was thinking of a native application, since my need is to provide an offline mobile application, that need to work without connection and sincronize later with the server. Correct me if i'm wrong, but an html5 application can't or at least in bi-directional way.
Besides, my main application is already a webApp using Vaadin and i can run it on a tablet without problems, but it always need connection to the server.

This is just the first step of the project, now i'm trying to achieve an offline client (for android) wich don't really need to write data, but just read. But the next step is to achieve a replicated main software that can work on a laptop without connection.

to clarify: the main web app is on the central server, and all employee can connect directly, but a salesman may need to reach a customer and this way can't access the main servr, so it need a replicated app (a copy of the main web app) on his laptop and sync all the changes later.
Re: [CDO] on Android [message #938734 is a reply to message #938047] Wed, 10 October 2012 05:31 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 09.10.2012 15:58, schrieb Michele Preti:
> thank you for the reply
>
> Quote:
>> It strikes me though that an offline clone server is quite heavy for a mobile device, but who knows...
>
> I don't need the history, so i was planing to disable audits and keep just the last version of the object. Even so you
> think it's too heavy?
> Do it make sense use CDO for a mobile app or is it an overkill?
A normal CDO (online) client is not so fat because it only loads the objects that are needed and unloads them
automatically when possible. But an offline clone *repository* is kind of heavy. You can't disable branching or auditing
in it. You might be interested in the newer CDOWorkspace mechanism, which is similar to a CVS/SVN checkout and much
slimmer on the client side.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> Quote:
>> Not sure if you want to develop a native android app or a html5 application.
>
> I was thinking of a native application, since my need is to provide an offline mobile application, that need to work
> without connection and sincronize later with the server. Correct me if i'm wrong, but an html5 application can't or at
> least in bi-directional way.
> Besides, my main application is already a webApp using Vaadin and i can run it on a tablet without problems, but it
> always need connection to the server.
>
> This is just the first step of the project, now i'm trying to achieve an offline client (for android) wich don't
> really need to write data, but just read. But the next step is to achieve a replicated main software that can work on
> a laptop without connection.
>
> to clarify: the main web app is on the central server, and all employee can connect directly, but a salesman may need
> to reach a customer and this way can't access the main servr, so it need a replicated app (a copy of the main web app)
> on his laptop and sync all the changes later.


Re: [CDO] on Android [message #939444 is a reply to message #938734] Wed, 10 October 2012 19:12 Go to previous messageGo to next message
Michele Preti is currently offline Michele PretiFriend
Messages: 14
Registered: October 2012
Junior Member
Quote:
A normal CDO (online) client is not so fat because it only loads the objects that are needed and unloads them
automatically when possible.

But what is the slow thing?, CDO itself or the serialization and transmission of data across the net ? I don't want transmit CDO objects, my app is already a webb app and...it's quite as if it were a normal desktop application (using vaadin). This way i just need to use CDO locally on the server). But for the offline-thing i need a copy of the server on the client device.

Let forget for a while android. It's as i have 2 servers, and each server has it's own client. One of the servers is the master, the other the clone. CDO always work locally, if not for keep them in sync.

Quote:
You can't disable branching or auditing in it.

I don't really need audit in the main software (the server) and i know it can be disabled, so the clone should clone only the last revision (the only one available).
I don't need to use branching, if not for the cloning mechanism.

I read somewhere that CDOWorkspace was only a prototype and not really working, but if you say it can do, i'll check it out.
Re: [CDO] on Android [message #939462 is a reply to message #939444] Wed, 10 October 2012 19:35 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
Just had a quick view on vaadin which is much like Eclipse RAP, i.e. (almost) everything is done on the server-side, but the UI is rendered on the browser.
In short: I dont think you can make an offline clone of your repository on the client side in the web browser as it is mainly driven by javascript...
Re: [CDO] on Android [message #939622 is a reply to message #939462] Wed, 10 October 2012 23:26 Go to previous messageGo to next message
Michele Preti is currently offline Michele PretiFriend
Messages: 14
Registered: October 2012
Junior Member
Erdal Karaca wrote on Wed, 10 October 2012 15:35
Just had a quick view on vaadin which is much like Eclipse RAP, i.e. (almost) everything is done on the server-side, but the UI is rendered on the browser.
In short: I dont think you can make an offline clone of your repository on the client side in the web browser as it is mainly driven by javascript...


yea, it is. That's what i was trying to explain, i don't need :a RPC service, javascript clone or something like this.

The client device (not the app, the device whom execute the client (javascript)) also host the vaadin server, like the main app server do.
The only difference between the Main server and the "client" server is that the client should have just a clone repository of the Main server repository.

But that's not the point. The point of all this was:
- can CDO run on android ? It's compatible ? (in the while i'm setting up a project to test it myself, but not knowing CDO i need a bit to figure it out, and i was asking if someone has tryed it before)
- it seem reasonable to use CDO (at least CDOWorkspace) for an android native app (if it work) ?

I'm soorry, maybe i'v put too many arguments in this discussion.
Re: [CDO] on Android [message #1429378 is a reply to message #939622] Tue, 23 September 2014 06:40 Go to previous messageGo to next message
Andreas Rytina is currently offline Andreas RytinaFriend
Messages: 3
Registered: September 2014
Junior Member
Hello Michele,
I'm a android developer with some experience in CDO & EMF and also trying to run CDO on Android. My use case is a bit different than yours. I want to develop a native Peer-to-Peer Chatting App. So in my scenario I need also to run the server part of CDO on Android. Android comes with a SQLite database but I haven't found yet a CDO-Adapter for SQLite. My first step is to work on a plain Net4J-based Android App (without CDO). After I'm finished with the Net4J-App I will work on the CDO-Adapter for SQLite and then get the CDO server part running on android. This is my plan for now Smile
Do you have new findings regarding CDO on Android?

Cheers,
Andy (Twitter: @andyrytina)
Re: [CDO] on Android [message #1434821 is a reply to message #1429378] Tue, 30 September 2014 16:50 Go to previous messageGo to next message
Andreas Rytina is currently offline Andreas RytinaFriend
Messages: 3
Registered: September 2014
Junior Member
Hello,
I successfully integrated all the dependent CDO Jars which are needed for the client part of my Android App. These are:

org.eclipse.emf.cdo.common_4.1.2.v20130122-0633.jar
org.eclipse.emf.cdo.net4j_4.1.0.v20120821-1005.jar
org.eclipse.emf.cdo_4.1.2.v20130122-0633.jar
org.eclipse.emf.common_2.8.0.v20130125-0546.jar
org.eclipse.emf.ecore_2.8.3.v20130125-0546.jar
org.eclipse.emf.examples.library.jar
org.eclipse.equinox.common_3.6.100.v20120522-1841.jar
org.eclipse.net4j.tcp_4.1.0.v20120821-1005.jar
org.eclipse.net4j.util_3.2.2.v20121028-0914.jar
org.eclipse.net4j_4.1.2.v20120929-0602.jar

The good news is that all the CDO dependencies compile fine with the Android DEX Compiler and I can start my app. But unfortunately at runtime when I create a managed container with ContainerUtil.createContainer() the app crashes. The stack trace is:

09-30 18:26:18.869: I/ActivityManager(228): Starting: Intent { cmp=com.partnerapp/.activity.ChatActivity } from pid 5220
09-30 18:26:18.909: I/dalvikvm(5220): Could not find method org.eclipse.core.runtime.Platform.getExtensionRegistry, referenced from method org.eclipse.net4j.internal.util.bundle.AbstractPlatform.internalExtensionRegistryAvailable
09-30 18:26:18.909: W/dalvikvm(5220): VFY: unable to resolve static method 26255: Lorg/eclipse/core/runtime/Platform;.getExtensionRegistry ()Lorg/eclipse/core/runtime/IExtensionRegistry;
09-30 18:26:18.909: D/dalvikvm(5220): VFY: replacing opcode 0x71 at 0x0000
09-30 18:26:18.909: D/dalvikvm(5220): VFY: dead code 0x0003-0009 in Lorg/eclipse/net4j/internal/util/bundle/AbstractPlatform;.internalExtensionRegistryAvailable ()Z
09-30 18:26:18.929: W/System.err(5220): java.lang.NullPointerException
09-30 18:26:18.929: W/System.err(5220): at org.eclipse.net4j.internal.util.om.LegacyBundle.trimSegments(LegacyBundle.java:313)
09-30 18:26:18.929: W/System.err(5220): at org.eclipse.net4j.internal.util.om.LegacyBundle.getClassesURL(LegacyBundle.java:296)
09-30 18:26:18.929: W/System.err(5220): at org.eclipse.net4j.internal.util.om.LegacyBundle.computeBaseURL(LegacyBundle.java:226)
09-30 18:26:18.929: W/System.err(5220): at org.eclipse.net4j.internal.util.om.LegacyBundle.<init>(LegacyBundle.java:48)
09-30 18:26:18.929: W/System.err(5220): at org.eclipse.net4j.internal.util.om.LegacyPlatform.createBundle(LegacyPlatform.java:39)
09-30 18:26:18.929: W/System.err(5220): at org.eclipse.net4j.internal.util.bundle.AbstractPlatform.bundle(AbstractPlatform.java:92)
09-30 18:26:18.929: W/System.err(5220): at org.eclipse.net4j.internal.util.bundle.OM.<clinit>(OM.java:38)
09-30 18:26:18.929: W/System.err(5220): at org.eclipse.net4j.util.lifecycle.Lifecycle.<clinit>(Lifecycle.java:34)
09-30 18:26:18.929: W/System.err(5220): at org.eclipse.net4j.util.container.ContainerUtil.createContainer(ContainerUtil.java:88)
09-30 18:26:18.929: W/System.err(5220): at com.partnerapp.activity.ChatActivity.testChat(ChatActivity.java:34)
09-30 18:26:18.929: W/System.err(5220): at com.partnerapp.activity.ChatActivity.onCreate(ChatActivity.java:30)
09-30 18:26:18.929: W/System.err(5220): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-30 18:26:18.929: W/System.err(5220): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
09-30 18:26:18.929: W/System.err(5220): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
09-30 18:26:18.929: W/System.err(5220): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
09-30 18:26:18.929: W/System.err(5220): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
09-30 18:26:18.929: W/System.err(5220): at android.os.Handler.dispatchMessage(Handler.java:99)
09-30 18:26:18.929: W/System.err(5220): at android.os.Looper.loop(Looper.java:130)
09-30 18:26:18.929: W/System.err(5220): at android.app.ActivityThread.main(ActivityThread.java:3835)
09-30 18:26:18.929: W/System.err(5220): at java.lang.reflect.Method.invokeNative(Native Method)
09-30 18:26:18.929: W/System.err(5220): at java.lang.reflect.Method.invoke(Method.java:507)
09-30 18:26:18.929: W/System.err(5220): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
09-30 18:26:18.929: W/System.err(5220): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
09-30 18:26:18.929: W/System.err(5220): at dalvik.system.NativeStart.main(Native Method)

I can see that after LegacyBundle.getClassesURL() in trimSegments() a NullPointerException is thrown. May be the reason for this is a different classpath handling in Dalvik? Can someone give me a hint?
Re: [CDO] on Android [message #1435506 is a reply to message #939622] Wed, 01 October 2014 15:47 Go to previous message
Andreas Rytina is currently offline Andreas RytinaFriend
Messages: 3
Registered: September 2014
Junior Member
The reason for the crash is because in line 293 of LegacyBundle the method call accessor.getResource(ReflectUtil.getSimpleName(accessor) + ".class") returns null. This is because Dalvik & ART do not work with class files, instead they load the classes from dex-files. So far I know, it is also not possible to load classes by URL, instead they can be loaded through Class.forName(className). In Net4j is some class loading going on relative to a baseURL which is derived from LegacyBundle.computeBaseURL(). This doesn't work on Android.

My new plan is to fork Net4j and replace the URL-based classloading stuff with Class.forName(className) calls. Can someone guide me please, how to introduce a new Bundle for Android besides the one for plain java "LegacyBundle" and the one for OSGi "OSGiBundle" without breaking the existing architecture. Thank you very much!

Cheers,
Andy

[Updated on: Wed, 01 October 2014 16:02]

Report message to a moderator

Previous Topic:Copying derived attribute
Next Topic:Example of extending an ecore model
Goto Forum:
  


Current Time: Fri Apr 19 22:52:59 GMT 2024

Powered by FUDForum. Page generated in 0.03657 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top