Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7404575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:16:28+00:00 2026-05-29T05:16:28+00:00

I have created the following entities in Android :- Android MyService (apk) MyServiceClient (jar)

  • 0

I have created the following entities in Android :-

  1. Android MyService (apk)
  2. MyServiceClient (jar)
  3. MyApplication (uses MyService via MyServiceClient)

For IPC, I have used AIDL. A sample implementation (of service client) is given below.

AIDL interface – ICLAZZ.aidl(Implemented on the service side, and used internally for IPC with service)
Service Client Side –
CLAZZ.java (API exposed to developers)

ICLAZZ.aidl

interface ICLAZZ {
 void doSomething();
}

CLAZZ.java

public class CLAZZ 
{
  private ICLAZZ mSvcInstance; //remote object


  // static method, instead of constructor for object creation due to some reason


  public static synchronized CLAZZ getInstance(inputParam) 
  {
  // ICLAZZ remoteObject = get the remote object from service

  if(remoteObject!=null) {
    INSTANCE = new INSTANCE(inputParam);
    INSTANCE.mSvcInstance = remoteObject;
   }

   return INSTANCE;

  }

  private CLAZZ() {
  }


  private CLAZZ(inputParam) {
   // initialize based on inputParam
  }

  public void doSomething() {
   if(mSvcInstance!=null)
     mSvcInstance.doSomething();
  }
};

When the API user calls CLAZZ.getInstance(), I create a remote object instance and save it in the local object of CLAZZ and return the CLAZZ object to the user.

The problem that I am facing is, that in case where the service restarts, all the previous remote objects gets invalidated. However, the API user may have saved the CLAZZ object created earlier and might want to call some functionality on it. This will cause the application to fail. Also, I dont want to keep any global list of API objects created by the application. In the given scenario, is there some mechanism through which I can handle this situation gracefully and provide recovery for existing objects.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:16:28+00:00Added an answer on May 29, 2026 at 5:16 am

    Sounds like the same problem as with RMI on standard Java.

    When the remote object fails, simply get a new remote object (Bind on Android) from the service.

    Ed

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Supose I have following entities created from database tables: Person Student Student include Person
I am following the tutorial on sharparchitecture.net. I have created a few entities using
I have created following rule in the .htaccess file located at the root of
I have created the following stored procedure.. CREATE PROCEDURE [dbo].[UDSPRBHPRIMBUSTYPESTARTUP] ( @CODE CHAR(5) ,
I have created the following C library for reading an image: typedef struct {
I have created the following project structure for my new asp.net mvc project any
I have created the following vsct file xml. <?xml version=1.0 encoding=utf-8?> <CommandTable xmlns=http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable xmlns:xs=http://www.w3.org/2001/XMLSchema>
Hey Guys, i have created the following Menu Structure: <div id=menu> <ul> <li><a href=#>Main
I have a created a following renderer which renders the JTree with checkboxes and
I have an ExpenseType object that I have created with the following migration: class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.