Understanding issue with RemoteService example in Android ApiDemos

by Android » Wed, 11 Feb 2009 21:30:09 GMT

Sponsored Links
 Hi ,

I have few understanding issues regarding the Remote service, could
you plz help me out.

I have gone through the RemoteService example in Android ApiDemos, but
i am not getting which file to run for Client site and which one at
Server site.

These are the list of files used for RemoteService


As per my knowledge the Server .APK should use the RemoteService.java,
IRemoteService.aidl ,IRemoteServiceCallback.aidl, ISecondary.aidl.

Client .APK shoud use RemoteServiceBinding.java,
IRemoteService.aidl ,IRemoteServiceCallback.aidl, ISecondary.aidl. Not
sure whether my understanding is correct, plz suggest.

I am not getting exactly the flow to start the Remote Service, i mean
how to start the Client APK and Server APK. Is it first i have to run
the Server APK and then will start the Client APK. The AIDL would be
used to communicate between the Client and Server, but i didn't able
to get where exactly the Client triggers to start the service in
Server site.

Could you please provide a detail explanation to proceed, that would
be really helpful for me.


Other Threads

1. Image does't appear from sqlite

Hi all.

I would like to save an image from Internet to database, I've tried to
convert images into bytearray and store them in a database.

Here my code:

this is to created table:

and this is my Method to Insert table:

public void insertlistNews(String city,byte[] newsImageUrl, String

try {

 myDB.execSQL("INSERT INTO News (title,imageUrl,publishDate,expiredDate)"

  + " VALUES ('" + city + "','" + imageUrl + "','" + publishDate+ "','" +

Log.i("Android", "Table created");

} catch (Exception e) {

Log.i("Android", "No Table created" + e.getMessage());


//for check bytearray in database

Log.i("Android", "Image saved in database: "+ urlFrontImage);


The last my method for getNews from db:

public ArrayList getAllNews() {

 ArrayList news = new ArrayList<News>();

 Cursor c = myDB.rawQuery("SELECT title,imageUrl,publishDate,expiredDate

FROM News WHERE publishedDate <= DATETIME() and expiredDate >= DATETIME()

 if (c != null) {


  int count = 0;

  while (c.moveToNext()) {

   if (count == 0)


   String title = c.getString(0);

   byte[] image = c.getBlob(1);

   String publishDate = c.getString(2);

   String expiredDate = c.getString(3);

   Log.i("Android", "Image get from db: "+image);





return news;


when I run it the newsimage not appear and the Log like this:

12-22 00:11:49.362: INFO/Android(307): Image saved in database: [...@437cbdb8

12-22 00:11:51.052: INFO/Android(307): Image saved in database: [...@437db710

12-22 00:11:51.862: INFO/Android(307): Image saved in database: [...@437c1338

12-22 00:12:07.982: INFO/Android(307): Image get from db db: [...@4382d9c0

12-22 00:12:07.992: INFO/Android(307): Image get from db: [...@4382e0e0

why results can vary between the insert and getNews?

Best Regards



2. Cannot define a float as a resource?

Am I missing something or there is no mechanism to define a float
value as a resource?

I am trying to have a locale dependent weight added to some of my
buttons.  Right now, as a workaround, I am defining the weight as an
Integer and then divide and manualy set it.  But why would there be
such a seemingly arbitrary decision made as not to allow floats but
allow ints?


3. Android - InputStream SQLiteDatabase - How to read more than one xml file

4. attempting to build gingerbread

5. Problem with password based encryption of image files

6. c2DM error when third-party server sends data to push

7. Navigation