Example usage for android.os RemoteException printStackTrace

List of usage examples for android.os RemoteException printStackTrace

Introduction

In this page you can find the example usage for android.os RemoteException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:pl.poznan.put.cs.ify.app.MainActivity.java

public void disableRecipe(int id) {
    Message msg = Message.obtain(null, ServiceHandler.REQUEST_DISABLE_RECIPE);
    msg.arg1 = id;//  www.  j av  a  2  s . c  om
    try {
        mService.send(msg);
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}

From source file:pl.poznan.put.cs.ify.app.MainActivity.java

public void logout() {
    Message msg = Message.obtain();/*w  ww .  j  a va 2  s  .  com*/
    Bundle b = new Bundle();
    msg.what = ServiceHandler.REQUEST_LOGOUT;
    try {
        mService.send(msg);
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}

From source file:com.ds.owl.dsdormitory.RecoBackgroundRangingService.java

private void startMonitoring() {
    Log.i("BackRangingService", "startMonitoring()");

    mRecoManager.setScanPeriod(this.mScanDuration);
    mRecoManager.setSleepPeriod(this.mSleepDuration);

    for (RECOBeaconRegion region : mRegions) {
        try {//from w ww. j a v  a2 s  . c om
            mRecoManager.startMonitoringForRegion(region);
        } catch (RemoteException e) {
            Log.e("BackRangingService",
                    "RemoteException has occured while executing RECOManager.startMonitoringForRegion()");
            e.printStackTrace();
        } catch (NullPointerException e) {
            Log.e("BackRangingService",
                    "NullPointerException has occured while executing RECOManager.startMonitoringForRegion()");
            e.printStackTrace();
        }
    }
}

From source file:pl.poznan.put.cs.ify.app.MainActivity.java

public void activateRecipe(String recipe, YParamList requiredParams) {
    Message msg = Message.obtain(null, ServiceHandler.REGISTER_Recipe);
    Bundle bundle = new Bundle();
    bundle.putString(YRecipesService.Recipe, recipe);
    bundle.putParcelable(YRecipesService.PARAMS, requiredParams);
    msg.setData(bundle);/*from  ww  w .ja  va2 s .co  m*/
    try {
        mService.send(msg);
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}

From source file:com.piusvelte.mosaic.android.MosaicMap.java

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    getActivity();/*from   www  .j  a v a 2 s.  com*/
    if ((requestCode == REQUEST_INSERT_MESSAGE) && (resultCode == Activity.RESULT_OK)) {
        try {
            iLocationService.insertMessage(data.getStringExtra(Mosaic.EXTRA_TITLE),
                    data.getStringExtra(Mosaic.EXTRA_BODY), data.getIntExtra(Mosaic.EXTRA_LATITUDE, 0),
                    data.getIntExtra(Mosaic.EXTRA_LONGITUDE, 0), data.getIntExtra(Mosaic.EXTRA_RADIUS, 0),
                    data.getLongExtra(Mosaic.EXTRA_EXPIRY, Mosaic.NEVER_EXPIRES));
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    } else {
        getActivity();
        if ((requestCode == REQUEST_UPDATE_MESSAGE) && (resultCode == Activity.RESULT_OK)) {
            if (data.hasExtra(Mosaic.EXTRA_TITLE)) {
                try {
                    iLocationService.updateMessage(data.getLongExtra(Mosaic.EXTRA_ID, Mosaic.INVALID_ID),
                            data.getStringExtra(Mosaic.EXTRA_TITLE), data.getStringExtra(Mosaic.EXTRA_BODY),
                            data.getIntExtra(Mosaic.EXTRA_RADIUS, 0),
                            data.getLongExtra(Mosaic.EXTRA_EXPIRY, Mosaic.NEVER_EXPIRES));
                } catch (RemoteException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            } else {
                Long id = data.getLongExtra(Mosaic.EXTRA_ID, Mosaic.INVALID_ID);
                if (markers.containsKey(id)) {
                    messages.remove(markers.get(id).getId());
                    markers.remove(id).remove();
                }
                if (polygons.containsKey(id))
                    polygons.remove(id).remove();
                try {
                    iLocationService.removeMessage(id);
                } catch (RemoteException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        } else {
            if ((requestCode == REQUEST_VIEW_MESSAGE) && (resultCode == Activity.RESULT_OK)) {
                try {
                    iLocationService.reportMessage(data.getLongExtra(Mosaic.EXTRA_ID, Mosaic.INVALID_ID));
                } catch (RemoteException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        }
    }
}

From source file:pl.poznan.put.cs.ify.app.MainActivity.java

public void requestRecipesList() {
    if (mService != null) {
        Message msg = Message.obtain(null, ServiceHandler.REQUEST_AVAILABLE_RecipeS);
        try {// w ww  .  ja v a2s . co m
            mService.send(msg);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }
}

From source file:pl.poznan.put.cs.ify.app.MainActivity.java

public void onServerUrlChanged() {
    if (mService != null) {
        Message msg = Message.obtain(null, ServiceHandler.REQUEST_RESTART_GROUP_RECIPES);
        try {/* w ww  . ja  va  2  s.co  m*/
            mService.send(msg);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }
}

From source file:pl.poznan.put.cs.ify.app.MainActivity.java

public void removeAvailableRecipe(String name) {
    if (mService != null) {
        Message msg = Message.obtain();//from   w w  w . j  av  a 2 s.c  o m
        Bundle b = new Bundle();
        msg.what = ServiceHandler.REQUEST_REMOVE_AVAILABLE_RECIPE;
        b.putString(YRecipesService.Recipe, name);
        msg.setData(b);
        try {
            mService.send(msg);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }
}

From source file:pl.poznan.put.cs.ify.app.MainActivity.java

public void login(String login, String passwd) {
    if (mService != null) {
        Message msg = Message.obtain();//from  w  ww  .ja va  2  s  .com
        Bundle b = new Bundle();
        msg.what = ServiceHandler.REQUEST_LOGIN;
        b.putString(ServiceHandler.LOGIN, login);
        b.putString(ServiceHandler.PASSWD, passwd);
        msg.setData(b);
        try {
            mService.send(msg);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }
}

From source file:com.drinviewer.droiddrinviewer.ServerListFragment.java

/**
 * onResume Fragment method//from  www .  j  ava2  s  .  co m
 */
@Override
public void onResume() {
    super.onResume();
    mustUpdateUI = true;

    try {
        if (discoverServerApi != null) {
            /**
             *  if the service is doing a discovery, just set the
             *  discoverServerProgress visibility to visible. 
             *  The service will call the listener when it has finished
             */
            if (discoverServerApi.isRunning()) {
                if (mActivity != null) {
                    mActivity.getMessageHandler().sendEmptyMessage(DroidDrinViewerConstants.MSG_DISCOVER_START);
                }
            } else {
                /**
                 * If the service is not doing a discovery,
                 * ask him for the most up-to-date host collection
                 * set it in the adapter and display it
                 */
                final DrinHostCollection newCollection = discoverServerApi.getMostUpToDateCollection();
                if (mActivity != null) {
                    mActivity.runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            if (newCollection != null) {
                                getAdapter().setHostCollection(newCollection);
                            } else {
                                getAdapter().initHostCollection();
                            }
                            getAdapter().notifyDataSetChanged();
                        }
                    });
                    /**
                     * either the hostcollection has been set or voided,
                     * turn off the discoverServerProgress
                     */
                    mActivity.getMessageHandler().sendEmptyMessage(DroidDrinViewerConstants.MSG_DISCOVER_DONE);
                }
            }
        } else {
            /**
             * Bind the DiscoverServerService if it is not, note that the onServiceConnected
             * method will send a startdiscovery message to the DrinViewerBroadcastReceiver
             * as soon as the service gets connected at startup
             */
            if (!isBound) {
                Intent intent = new Intent(mActivity.getApplication(), DiscoverServerService.class);
                intent.setAction(DiscoverServerService.class.getName());
                isBound = mActivity.getApplication().bindService(intent, this,
                        Context.BIND_AUTO_CREATE | Context.BIND_NOT_FOREGROUND);
            }
        }
    } catch (RemoteException e) {
        // ignore
        e.printStackTrace();
    }
}