what want defineClass(...) ?!

by HotHeart » Fri, 28 Nov 2008 23:58:35 GMT

Sponsored Links

I read some topics and founded that defineClass fails if use java
But how to convert Java Byte-code to Dalvik ByteCode on runtime?



what want defineClass(...) ?!

by Ralf » Sat, 29 Nov 2008 02:46:27 GMT

 You can't. Simply package your java .class in your project and
ant/eclipse will convert it when building your app.



Sponsored Links

what want defineClass(...) ?!

by Jakob Sachse » Fri, 09 Jan 2009 22:33:44 GMT

 but in some cases this is not an option. i.e I want to run Rhino on
Andorid, which goes well for the interpreter mode, but not in
compilation mode since it produces bytecode.


what want defineClass(...) ?!

by Mark Murphy » Fri, 09 Jan 2009 22:46:00 GMT


Which gets back to Ralf's original point:

"You can't."

AFAIK, dynamic languages that generate Java VM bytecode will need to be
augmented to generate Dalvik VM bytecode. Or, use interpreters that do
not generate bytecode (e.g., beanshell).

Mark Murphy (a Commons Guy)

Android Training on the Ranch! -- Mar 16-20, 2009


Other Threads

1. unable to install ADT plugin for europa eclipse 3.3

Use eclipse gynamede, instead of europa

2009/8/4 nikita <panchal.nik...@gmail.com>

Shine bright,
(: Naveen Krishna Ch :)


2. Start a Calendar EditEvent Activity

I am having trouble starting a Calendar EditEvent activity with the
correct info.  I have a simple Event class that holds all of my
information and on the selection of a menu item I pass the information
to the EditEvent activity and all of it shows up correctly except the
date and time.  It always populates with the current date and time
with an event duration of 1 hour.  That is unless the allDay flag is
set, then it's just the current date.  Is there something wrong with
how I'm formatting the time?  It comes across in the format

public class Event
        public static final String EVENT_BEGIN_TIME = "beginTime";
        public static final String EVENT_END_TIME = "endTime";
        public static final String EVENT_ALL_DAY = "allDay";
        public static final String EVENT_TITLE = "title";
        public static final String EVENT_DESCRIPTION = "description";
        public static final String EVENT_LOCATION = "eventLocation";

        private String mTitle;
        private String mDescription;
        private Time mStartTime;
        private Time mStopTime;
        private boolean mAllDay;
        private String mVenueName;

        public String getTitle() { return mTitle; }
        public void setTitle(String title) { mTitle = title; }

        public String getDescription() { return mDescription; }
        public void setDescription(String description) { mDescription =
description; }

        public Time getStartTime() { return mStartTime; }
        public void setStartTime(Time startTime) { mStartTime = startTime; }

        public Time getStopTime() { return mStopTime; }
        public void setStopTime(Time stopTime) { mStopTime = stopTime; }

        public boolean isAllDay() { return mAllDay; }
        public void setAllDay(boolean allDay) { mAllDay = allDay; }

        public String getVenueName() { return mVenueName; }
        public void setVenueName(String venueName) { mVenueName =
venueName; }

public boolean onOptionsItemSelected(MenuItem item)
        if(item.getItemId() == _SEND_TO_CALENDAR_)
                Intent intent = new Intent(Intent.ACTION_EDIT);
                if(mEvent.getStartTime() != null)
                if(mEvent.getStopTime() != null)
                        intent.putExtra(Event.EVENT_END_TIME, mEvent.getStopTime
                intent.putExtra(Event.EVENT_ALL_DAY, mEvent.isAllDay());
                intent.putExtra(Event.EVENT_TITLE, mEvent.getTitle());
                intent.putExtra(Event.EVENT_LOCATION, mEvent.getVenueName());

                return true;

3. Unhandled Exception

4. Help with Mac OSX

5. Adding drivers/libs for new hardware

6. Trouble creating avd

7. Supporting RTL language