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 MainActivity extends Activity { | |
private static final String TAG = "MainActivity"; | |
@Override | |
public void onCreate(Bundle savedInstance) { | |
super.onCreate(savedInstance); | |
Joycity.getInstance().init(getApplicationContext, this, ""); | |
} |
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
public class ObjectTest { | |
@Test | |
public void objectTest() { | |
Marine redMarine = new Marine(); | |
Marine blueMarine = new Marine(); | |
Class<? extends Marine> clazz = redMarine.getClass(); | |
} | |
} |
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 ObjectTest { | |
@Test | |
public void objectTest() { | |
Marine redMarine = new Marine(); | |
Marine blueMarine = new Marine(); | |
System.out.println("hashCode() = " + redMarine.hashCode() + ":" + blueMarine); | |
System.out.println("equals() = " + redMarine.equals(blueMarine)); | |
} |
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)) |
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
@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
<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
<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
<!-- 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> |
OlderNewer