This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JoycityCommonService commonService = (JoycityCommonService) Joycity.getService(Joycity.COMMON_API); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void updatePushStatus() { | |
JoycityNotificationService pushService = (JoycityNotificationService) Joycity.getService(Joycity.NOTIFICATION); | |
pushService.requestUpdatePushStatus(eventReceiver); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JoycityNotificationService pushService = (JoycityNotificationService) Joycity.getService(Joycity.NOTIFICATION); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final ServerInfo SERVER = ServerInfo.SANDBOX; | |
private static final int GAME_CODE = 8887; | |
private static final Publisher PUBLISHER = Publisher.JOYCITY; | |
private static final Market MARKET = Market.GOOGLE; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
.... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Joycity additional configurations--> | |
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> | |
<meta-data android:name="com.joycity.platform.gcm_id" android:value="@string/joycity_gcm_sender_id"/> | |
<receiver | |
android:name="com.joycity.platform.GcmBroadcastReceiver" | |
android:permission="com.google.android.c2dm.permission.SEND" > | |
<intent-filter > | |
<action android:name="com.google.android.c2dm.intent.RECEIVE"/> | |
<category android:name="com.joycity.platform"/> | |
</intent-filter> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> | |
<uses-permission android:name="android.permission.WAKE_LOCK" /> | |
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> | |
<permission android:name="com.joycity.rulethesky.permission.C2D_MESSAGE" android:protectionLevel="signature" /> | |
<uses-permission android:name="com.joycity.rulethesky.permission.C2D_MESSAGE" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<activity | |
android:name="com.jce.sample.push.MainActivity" | |
android:configChanges="orientation|keyboardHidden" | |
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" | |
android:label="@string/app_name" > | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.LAUNCHER" /> | |
</intent-filter> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void printObjectTest() throws Throwable { | |
Marine redMarine = new Marine("red"); | |
System.out.println("toString() = " + redMarine.toString()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void hashCodeTest() { | |
Map<Marine, Integer> barrack = new HashMap<Marine, Integer>(); | |
barrack.put(redMarine, 1); | |
barrack.put(blueMarine, 2); | |
Integer level = barrack.get(new Marine("red")); | |
System.out.println("Red marine's level = " + level); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Marine { | |
private String color; | |
public Marine(String color) { | |
this.color = color; | |
} | |
@Override | |
public boolean equals(Object obj) { | |
if(!(obj instanceof Marine)) |