Java tutorial
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package xtreme.com.push; import android.app.FragmentManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.util.Log; import ie.imobile.extremepush.PushConnector; import org.apache.cordova.*; public class push extends CordovaActivity { private PushConnector pushConnector; private BroadcastReceiver mReceiver; @Override public void onCreate(Bundle savedInstanceState) { //FragmentManager fm = getFragmentManager(); //pushConnector = PushConnector.init( getFragmentManager(), "eb22f3b665dca2c68a", "33474064823"); //pushConnector. super.onCreate(savedInstanceState); super.init(); // Set by <content src="index.html" /> in config.xml super.loadUrl(Config.getStartUrl()); //super.loadUrl("file:///android_asset/www/index.html"); /* IntentFilter intentFilter = new IntentFilter( "ie.imobile.extremepush.action_message"); mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { //extract our message from intent // String msg_for_me = intent.getStringExtra("some_msg"); //log our message value Log.i("InchooTutorial", "sd"); } }; this.registerReceiver(mReceiver, intentFilter); */ } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); pushConnector.onActivityResult(requestCode, resultCode, data); } @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); pushConnector.onNewIntent(intent); } }