当前位置: 首页>>代码示例>>Java>>正文


Java PebbleKit.closeAppOnPebble方法代码示例

本文整理汇总了Java中com.getpebble.android.kit.PebbleKit.closeAppOnPebble方法的典型用法代码示例。如果您正苦于以下问题:Java PebbleKit.closeAppOnPebble方法的具体用法?Java PebbleKit.closeAppOnPebble怎么用?Java PebbleKit.closeAppOnPebble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.getpebble.android.kit.PebbleKit的用法示例。


在下文中一共展示了PebbleKit.closeAppOnPebble方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startWatchApp

import com.getpebble.android.kit.PebbleKit; //导入方法依赖的package包/类
/**
    * Attempt to start the pebble_sd watch app on the pebble watch.
    */
   public void startWatchApp() {
       Log.v(TAG, "startWatchApp() - closing app first");
       mUtil.writeToSysLogFile("SdDataSourcePebble.startWatchApp() - closing app first");
       // first close the watch app if it is running.
       PebbleKit.closeAppOnPebble(mContext, SD_UUID);
       Log.v(TAG, "startWatchApp() - starting watch app after 5 seconds delay...");
// Wait 5 seconds then start the app.
       Timer appStartTimer = new Timer();
       appStartTimer.schedule(new TimerTask() {
           @Override
           public void run() {
               Log.v(TAG, "startWatchApp() - starting watch app...");
               mUtil.writeToSysLogFile("SdDataSourcePebble.startWatchApp() - starting watch app");
               PebbleKit.startAppOnPebble(mContext, SD_UUID);
           }
       }, 5000);
   }
 
开发者ID:OpenSeizureDetector,项目名称:Android_Pebble_SD,代码行数:21,代码来源:SdDataSourcePebble.java

示例2: onDestroy

import com.getpebble.android.kit.PebbleKit; //导入方法依赖的package包/类
/**
 * Closes the text file of words.
 */
@Override
protected void onDestroy()
{
    super.onDestroy();
    try
    {
        in.close();
    }
    catch ( IOException e )
    {
        e.printStackTrace();
    }

    if ( null != mReceiver )
    {
        unregisterReceiver( mReceiver );
    }

    PebbleKit.closeAppOnPebble( getApplicationContext(), MSG_UUID );
}
 
开发者ID:carlb15,项目名称:FunnyWordsWithPebble,代码行数:24,代码来源:MainActivity.java

示例3: closeApp

import com.getpebble.android.kit.PebbleKit; //导入方法依赖的package包/类
public void closeApp()
{
    Timber.d("CloseApp %s", currentRunningApp);

    NotificationSendingModule notificationSendingModule = NotificationSendingModule.get(getService());
    if (notificationSendingModule.isAnyNotificationWaiting())
        return;

    if (getService().getGlobalSettings().getBoolean(PebbleNotificationCenter.CLOSE_TO_LAST_APP, false) && canCloseToApp(currentRunningApp) && closeTries < 2)
        PebbleKit.startAppOnPebble(getService(), currentRunningApp);
    else
        PebbleKit.closeAppOnPebble(getService(), PebbleNotificationCenter.WATCHAPP_UUID);

    SharedPreferences.Editor editor = getService().getGlobalSettings().edit();
    editor.putLong("lastClose", System.currentTimeMillis());
    editor.apply();

    closeTries++;
}
 
开发者ID:matejdro,项目名称:PebbleNotificationCenter-Android,代码行数:20,代码来源:SystemModule.java

示例4: destory

import com.getpebble.android.kit.PebbleKit; //导入方法依赖的package包/类
/**
 * Pebble側のアプリを終了する.
 */
public void destory() {
    getContext().unregisterReceiver(mHandler);
    getContext().unregisterReceiver(mConnectHandler);
    getContext().unregisterReceiver(mDisconnectHandler);
    getContext().unregisterReceiver(mAckHandler);
    getContext().unregisterReceiver(mNackHandler);
    PebbleKit.closeAppOnPebble(getContext(), MY_UUID);
    mExecutor.shutdown();
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:13,代码来源:PebbleManager.java

示例5: onStartCommand

import com.getpebble.android.kit.PebbleKit; //导入方法依赖的package包/类
@Override
public int onStartCommand(Intent intent, int flags, int startid) {
    if(intent != null) {
        final String action = intent.getAction();
        lastReceivedAction = action;
        switch (action) {
            case GCSEvent.ACTION_VEHICLE_CONNECTION:
                PebbleKit.startAppOnPebble(applicationContext, DP_UUID);
                connParams = intent.getParcelableExtra("extra_connection_parameter");
                connect3DRServices();
                break;

            case GCSEvent.ACTION_VEHICLE_DISCONNECTION:
                PebbleKit.closeAppOnPebble(getApplicationContext(), DP_UUID);
                stopSelf();
                break;

            case ACTION_CHECK_CONNECTION_STATE:
                if (!drone.isConnected()) {
                    if(controlTower.isTowerConnected()){
                        checkConnectedApps();
                    }
                    else{
                        connect3DRServices();
                    }
                }
                break;

        }
    }

    //Start a watchdog to automatically stop the service when it's no longer needed.
    handler.removeCallbacks(destroyWatchdog);
    handler.postDelayed(destroyWatchdog, WATCHDOG_TIMEOUT);

    //Using redeliver intent because we want the intent to be resend if the service is killed.
    return START_REDELIVER_INTENT;
}
 
开发者ID:DroidPlanner,项目名称:tower-pebble,代码行数:39,代码来源:PebbleCommunicatorService.java

示例6: noNetworkFound

import com.getpebble.android.kit.PebbleKit; //导入方法依赖的package包/类
public void noNetworkFound () {
	if (PebbleKit.areAppMessagesSupported(getApplicationContext())) {
		PebbleDictionary networkFail = new PebbleDictionary();
		networkFail.addUint8(0, (byte) 0);
		networkFail.addUint8(1, (byte) 0); // Filler value
		networkFail.addString(2, "LIFX Network not found.");
		Log.i("Dictionary", networkFail.toJsonString());
		PebbleKit.sendDataToPebble(getApplicationContext(), PEBBLE_APP_UUID, networkFail);
		Log.i("", "Data sent.");
	}
	PebbleKit.closeAppOnPebble(getApplicationContext(), PEBBLE_APP_UUID);
}
 
开发者ID:jadengore,项目名称:PebbLIFX,代码行数:13,代码来源:PebbLIFXService.java

示例7: killApp

import com.getpebble.android.kit.PebbleKit; //导入方法依赖的package包/类
@Kroll.method
public void killApp(HashMap args)
{
	Log.d(LCAT, "killApp");
	
	if(!checkWatchConnected())
	{
		Log.w(LCAT, "killApp: No watch connected");
		
		return;
	}
	
	final KrollFunction successCallback = (KrollFunction)args.get("success");
	final KrollFunction errorCallback = (KrollFunction)args.get("error");
	
	try
	{
		PebbleKit.closeAppOnPebble(getApplicationContext(), uuid);
		
		Log.d(LCAT, "killApp: Success");
		
		if(successCallback != null)
		{
			HashMap event = new HashMap();
			event.put("message", "Successfully killed app");
			
			successCallback.call(getKrollObject(), event);
		}
	} catch(IllegalArgumentException e) {
		Log.e(LCAT, "killApp: Error");
		
		if(errorCallback != null)
		{
			errorCallback.call(getKrollObject(), new Object[] {});
		}
		
		return;
	}
}
 
开发者ID:mcongrove,项目名称:TitaniumPebble,代码行数:40,代码来源:TitaniumPebbleModule.java

示例8: closeApp

import com.getpebble.android.kit.PebbleKit; //导入方法依赖的package包/类
public void closeApp()
{
    Timber.d("CloseApp %s", currentRunningApp);

    if (getService().getGlobalSettings().getBoolean("closeToLastApp", false) && canCloseToApp(currentRunningApp) && closeTries < 2)
        PebbleKit.startAppOnPebble(getService(), currentRunningApp);
    else
        PebbleKit.closeAppOnPebble(getService(), PebbleDialerApplication.WATCHAPP_UUID);

    closeTries++;
}
 
开发者ID:matejdro,项目名称:PebbleDialer-Android,代码行数:12,代码来源:SystemModule.java

示例9: sendCloseAppOnPebble

import com.getpebble.android.kit.PebbleKit; //导入方法依赖的package包/类
/**
 * Pebbleにアプリ終了イベントを送信する.
 */
public void sendCloseAppOnPebble() {
    PebbleKit.closeAppOnPebble(getContext(), MY_UUID);
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:7,代码来源:PebbleManager.java

示例10: onDroneEvent

import com.getpebble.android.kit.PebbleKit; //导入方法依赖的package包/类
@Override
public void onDroneEvent(String event, Bundle bundle) {
    try {
        final String action = new Intent(event).getAction();
        switch (action) {
            case AttributeEvent.STATE_DISCONNECTED:
                PebbleKit.closeAppOnPebble(applicationContext, DP_UUID);
                stopSelf();
                break;
            case AttributeEvent.STATE_CONNECTED:
            case AttributeEvent.HEARTBEAT_FIRST:
                PebbleKit.startAppOnPebble(applicationContext, DP_UUID);
                Thread.sleep(250);
                sendDataToWatchNow(drone);
                break;
            //Telem gets slow updates
            case AttributeEvent.BATTERY_UPDATED:
            case AttributeEvent.ATTITUDE_UPDATED:
                sendDataToWatchIfTimeHasElapsed(drone);
                break;
            //Mode changes get fast updates
            case AttributeEvent.STATE_VEHICLE_MODE:
            case AttributeEvent.FOLLOW_START:
            case AttributeEvent.STATE_ARMING:
            case AttributeEvent.STATE_UPDATED:
                sendDataToWatchNow(drone);
                break;
            //Follow type update gets fast update
            case AttributeEvent.FOLLOW_UPDATE:
                final FollowState followState = drone.getAttribute(AttributeType.FOLLOW_STATE);
                if(followState != null){
                    final FollowType followType = followState.getMode();
                    if(!previousFollowType.equals(followType)){
                        previousFollowType = followType;
                        sendDataToWatchNow(drone);
                    }
                }
        }
    }catch(Exception e){
        //TODO figure out what was messing up here
    }
}
 
开发者ID:DroidPlanner,项目名称:tower-pebble,代码行数:43,代码来源:PebbleCommunicatorService.java

示例11: stopWatchApp

import com.getpebble.android.kit.PebbleKit; //导入方法依赖的package包/类
/**
 * stop the pebble_sd watch app on the pebble watch.
 */
public void stopWatchApp() {
    Log.v(TAG, "stopWatchApp()");
    mUtil.writeToSysLogFile("SdDataSourcePebble.stopWatchApp()");
    PebbleKit.closeAppOnPebble(mContext, SD_UUID);
}
 
开发者ID:OpenSeizureDetector,项目名称:Android_Pebble_SD,代码行数:9,代码来源:SdDataSourcePebble.java

示例12: stopWatchApp

import com.getpebble.android.kit.PebbleKit; //导入方法依赖的package包/类
public void stopWatchApp() {
    PebbleKit.closeAppOnPebble(getApplicationContext(), uuid);
}
 
开发者ID:WebMajstr-,项目名称:pebble-navigation,代码行数:4,代码来源:WatchService.java

示例13: hideWatchFace

import com.getpebble.android.kit.PebbleKit; //导入方法依赖的package包/类
@Override
public void hideWatchFace() {
    PebbleKit.closeAppOnPebble(_applicationContext,Constants.WATCH_UUID);
}
 
开发者ID:team-mount-ventoux,项目名称:JayPS-AndroidApp,代码行数:5,代码来源:MessageManager.java


注:本文中的com.getpebble.android.kit.PebbleKit.closeAppOnPebble方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。