Project

General

Profile

Support #247

BeemApplication - interface suggestion.

Added by John Pope almost 9 years ago. Updated about 7 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
Conception
Target version:
-
Start date:
02/25/2010
Due date:
% Done:

0%

Estimated time:
Close

Description

Make it easy to re-use Beem in other applications by referencing an interface to BeemApplication and not the application class itself.

Eg.
in this class
public class XmppConnectionAdapter extends IXmppConnection.Stub

....

if (ctx instanceof BeemApplication) {
mApplication = (BeemApplication) ctx;
}else {
// PLEASE ADD THIS LINE with FATAL ERRORS!!!!!
Log.e(TAG,"mService.getApplicationContext() is not instance of BeemApplication");
}

I believe the BeemApplication reference should be replaced with an interface / IBeemApplication.

Eg.
Simply make BeemApplication.java
public class Application extends android.app.Application implements IBeemApplication

public interface IBeemApplication {

public boolean isConnected() ;
public void setConnected(boolean isConnected);
}

Then I can the implementation to my application and reuse beem framework in other applications.

if (ctx instanceof IBeemApplication) {
mApplication = (IBeemApplication) ctx;
}else {
Log.e(TAG,"Your application must implement IBeemApplication!");
}

History

#1 Updated by John Pope almost 9 years ago

this is feedback not a bug. sorry.

#2 Updated by Frédéric Barthéléry about 7 years ago

  • Tracker changed from Bug to Support

Also available in: Atom PDF