@TargetApi
(Build.VERSION_CODES.GINGERBREAD)
public
class
Main
extends
ActionBarActivity {
public
static
final
String EXTRA_MESSAGE =
"message"
;
public
static
final
String PROPERTY_REG_ID =
"registration_id"
;
private
static
final
String PROPERTY_APP_VERSION =
"appVersion"
;
private
static
final
int
PLAY_SERVICES_RESOLUTION_REQUEST =
9000
;
/**
* Substitute you own sender ID here. This is the project number you got
* from the API Console, as described in "Getting Started."
*/
String SENDER_ID =
"542406813237"
;
/**
* Tag used on log messages.
*/
static
final
String TAG =
"GCM Demo"
;
TextView mDisplay;
GoogleCloudMessaging gcm;
AtomicInteger msgId =
new
AtomicInteger();
Context context;
String regid;
@Override
protected
void
onCreate(Bundle savedInstanceState) {
super
.onCreate(savedInstanceState);
setContentView(R.layout.main);
mDisplay = (TextView)
this
.findViewById(R.id.display);
context = getApplicationContext();