passing a class from one process to another

by DevilMayCry » Mon, 13 Apr 2009 12:12:42 GMT


Sponsored Links
 Hi guys i am looking for an example that allows me to pass a custom
class to a remote process. So far in the doc remote service example
only an integer is passed i would like to pass a class on my own. I
have implemented the parcelable protocol but i am really not  sure how
to pass that class. Any help please?

--~--~---------~--~----~------------~-------~--~----~



passing a class from one process to another

by Ralf » Mon, 13 Apr 2009 12:54:40 GMT


 You might want to read the section on the developer guide on AIDL and IPC:
 http://developer.android.com/guide/developing/tools/aidl.html 

It explains how you can send a Parceleable data via an IPC.
R/




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Question of displaying a ProgressDialog in a joined thread

Hello, i have a question of displaying a ProgressDialog by joining the
threads. In my application, i will synchronize data with the server,
and remove the synchronized data from database. The synchronization
takes long time, so i decide to display a progressdialog during this
process. Of course i use a new thread to deal the synchronization,
here is what i use for the first time:

syncProgressDialog = ProgressDialog.show(Function.getContext(),
"Please wait...", "Synchronizing application's data...", true, false);

new Thread(new Runnable() {
        public void run() {
                synchronize();
                syncProgressDialog.dismiss();
        }
}).start();

removeData();

The problem i met with this solution is the main thread didn't launch
this thread immediately, it called the removeData before the new
Thread. Apparently the main thread don't wait the new Thread finishes
before execute the following method. So i changed this solution to :

syncProgressDialog = ProgressDialog.show(Function.getContext(),
"Please wait...", "Synchronizing application's data...", true, false);

Thread thread = new Thread(new Runnable() {
        public void run() {
                synchronize();
                syncProgressDialog.dismiss();
        }
});
thread.start();
try {
        thread.join();
}
catch (InterruptedException e) {
        e.printStackTrace();
}

removeData();

I used the join method to wait the end of synchronize thread before
removeData, there is another problem comes, the ProgressDialog didn't
display on the screen. I tried use handler:

Thread thread = new Thread(new Runnable() {
        public void run() {
                synchronize();
                handler.post(new Runnable() {
                        public void run() {
                                removeDialog();
                        }
                });
        }
});

private void removeDialog() {
        syncProgressDialog.dismiss();
}

Nothing changed, could anyone show me a sample code to display the
ProgressDialog in a joined thread or tell me which part i didn't
implemented correctly.


--~--~---------~--~----~------------~-------~--~----~

2. Error when run "helloandroid"

when i run hello android like on
http://code.google.com/android/intro/hello-android.html, my eclipse
show error like this :
                   Tag <activity> missing required attribute name.      

and on AndroidManifest.xml there is an error on line :
                  <activity class=".helloandroid"
android:label="@string/app_name">



can u help me to fix this ?

thanks before :)

--~--~---------~--~----~------------~-------~--~----~

3. Need Android consultants - Los Angeles - 3-6 months

4. Need Android consultant with Java - Los Angeles - 3 months

5. ERROR No resource identifier found for attribute 'textAlign' in package 'android'

6. EditText box of emulator cannot type in these characters

7. how to reject an incoming call