Support #247
BeemApplication - interface suggestion.
0%
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!");
}