Back to project page ScoponeDaPolso.
The source code is released under:
GNU General Public License
If you think the Android project ScoponeDaPolso listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.gdg.bari.scopone.service; /*from w ww. j a va 2 s. c o m*/ import android.content.Intent; import android.widget.Toast; import com.google.android.gms.wearable.DataMap; import com.mariux.teleport.lib.TeleportService; import org.gdg.bari.scopone.fragment.GameFragment; /** * Created by tiziano on 18/11/14. */ public class MobileTeleportService extends TeleportService { private static final String STARTACTIVITY_WEAR = "startActivityOnWear"; @Override public void onCreate() { super.onCreate(); setOnGetMessageTask(new StartActivityTask()); setOnSyncDataItemTask(new DataSyncTask()); } //Task that shows the path of a received message public class StartActivityTask extends TeleportService.OnGetMessageTask { @Override protected void onPostExecute(String path) { //let`s reset the task (otherwise it will be executed only once) setOnGetMessageTask(new StartActivityTask()); } } public class DataSyncTask extends OnSyncDataItemTask { @Override protected void onPostExecute(DataMap result) { String playedCardJson = result.getString("shootedCardJson"); Intent handIntent = new Intent(); handIntent.setAction(GameFragment.ACTION_SHOOTED_CARD); handIntent.putExtra("shootedCardJson", playedCardJson); sendBroadcast(handIntent); setOnSyncDataItemTask(new DataSyncTask()); } } }