Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [emf-dev] Ported EMF to the Android platform

Thanks for the reply and for opening the bug. I'll take my follow-up comments to Bugzilla....

Cheers,
Dave

--
Dave Steinberg
Rational Software - IBM Toronto Lab
mailto:davidms@xxxxxxxxxx


Inactive hide details for Hui Song ---12/03/2009 12:12:29 AM---Dear Ed and Dave, Thank you very much for your kind replies. I'mHui Song ---12/03/2009 12:12:29 AM---Dear Ed and Dave, Thank you very much for your kind replies. I'm really glad to know you're


From:

Hui Song <songhui.cn@xxxxxxxxx>

To:

Eclipse Modelling Framework <emf-dev@xxxxxxxxxxx>

Date:

12/03/2009 12:12 AM

Subject:

Re: [emf-dev] Ported EMF to the Android platform

Sent by:

emf-dev-bounces@xxxxxxxxxxx




Dear Ed and Dave,

Thank you very much for your kind replies. I'm really glad to know you're interested about this work.

First, allow me to ramble a bit about the project involved in this work. It is a small research project developed from a simple idea to represent the runtime system data as a dynamic Ecore model, so that we can use the many EMF-based tools to process the data at runtime. Here the runtime data mean, for example, the wifi channels scanned by an Android Phone. Since different systems provide different APIs to access such data, we tried to provide a generation tool (extended from emfgen) to generate the "impl" classes which wrap the different system API as standard Ecore “impl” classes. We did some experiment for this tool on several platforms like J2EE and SWT window. And after we decide to experiment on Android, we face the problem to port EMF core onto Android.

The port work is actually quite simple (maybe naive:-)). Dalvik, the language used by Android, is quite compliant with Java. It employs the same syntax of Java, provides a sub set of the J2SE APIs, but uses different compiler and byte code. So the port work is just to crop the EMF code within the Dalvik limit, and recompile it using the Dalvik compiler. I put the source code of the three core plugins (emf.common, emf.ecore, emf.ecore.xmi) together, commented the lines of code which refer to the classes from other eclipse projects (like eclipse.plugin), and played some little trick when necessary (like changing "return EcorePlugin..." to "return null"). Now the source code was self-contained, only depending on the J2SE API. Since the Dalvik API is a sub set of J2SE API, I also imported some source code from J2SE API. Finally, I succeeded to compile the source code under Dalvik compiler:) Here shows all the changes:
http://code.google.com/p/smatrt/source/detail?r=12

For the idea of summarizing the change as an automated transformation, I guess we can find some code analysis tools to identify the classes outside a given scope, and use some pre-defined patterns to peel off the code...

I opened a bug report (296770), attached with the Android project I showed in my first mail. I'm sorry that this mail finally becomes so fat...

Thank you again for your attention and reply.

Sincerely!
Hui SONG
Dec. 3rd


On Wed, Dec 2, 2009 at 10:52 PM, Dave Steinberg <davidms@xxxxxxxxxx> wrote:
    Hi Hui,

    Thanks for letting us know about this and offering to share your work! I'm sure I can't be the only one who's very interested in Android and would really like to find out more about your port. I'd like to get an idea of how extensive the changes are. Creating a fork that requires constant updating to be kept in sync doesn't seem ideal; if we could somehow incorporate it into EMF core, that would no doubt be better.

    I'd suggest the easiest way to get started might be to open a bugzilla and attach your code there. Then we can take a look and figure out where to go next. If the changes aren't terribly extensive, perhaps posting them as a patch against the existing code base would be even better.

    Thanks again,
    Dave

    --
    Dave Steinberg
    Rational Software - IBM Toronto Lab

    mailto:davidms@xxxxxxxxxx


    Hui Song ---11/29/2009 10:09:58 PM---Dear EMF developers, As a part of a small project, I managed to port the EMF code into the


From:

Hui Song <songhui.cn@gmail.com>

To:

emf-dev@xxxxxxxxxxx

Date:

11/29/2009 10:09 PM

Subject:

[emf-dev] Ported EMF to the Android platform

Sent by:

emf-dev-bounces@xxxxxxxxxxx





    Dear EMF developers,

    As a part of a small project, I managed to port the EMF code into the
    Android platform.

    As you may know, Android is a mobile operation system, which employs a
    Java-compliant language and virtue machine named Dalvik. After some
    modifications to the source code, the core EMF packages (including
    emf.common, emf.ecore, emf.ecore.xmi) can now be compiled by Dalvik,
    and work well on an Android mobile phone.

    To show the uages of EMF on Android, I tried to wrap the main
    management capabilities of Android system as an Ecore model, so that
    we can write ocl rules to query the runtime information from an
    Android mobile phone, like "listing all the running activites",
    "counting all the clients", "listing the current wifi channels", as
    shown in the attached snapshots.

    If you have any interest, I will be very glad to contribute this work
    in any ways (e.g. as a branch, a sandbox, a emft project, and any
    other ways).

    If not, please forgive me for bothering.

    Sincerely!
    Hui SONG
    Nov. 30

    (See attached file: client_count.png)(See attached file: running_activities_process.png)(See attached file: scanned_wifi_channels.png)_______________________________________________

    emf-dev mailing list

    emf-dev@xxxxxxxxxxx
    https://dev.eclipse.org/mailman/listinfo/emf-dev



    _______________________________________________
    emf-dev mailing list

    emf-dev@xxxxxxxxxxx
    https://dev.eclipse.org/mailman/listinfo/emf-dev
_______________________________________________
emf-dev mailing list
emf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/emf-dev


GIF image

GIF image


Back to the top