Created
February 14, 2013 03:50
-
-
Save acidjazz/4950502 to your computer and use it in GitHub Desktop.
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
package com.rosetta.sms_sxsw; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import org.apache.cordova.*; | |
import android.telephony.TelephonyManager; | |
public class sms_sxsw extends DroidGap | |
{ | |
private static String imei; | |
private static String refer; | |
@Override | |
public void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); | |
// Set by <content src="index.html" /> in config.xml | |
super.loadUrl(Config.getStartUrl()); | |
//super.loadUrl("file:///android_asset/www/index.html") | |
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); | |
imei = tm.getDeviceId(); | |
super.loadUrl("javascript:window.IMEI=\"" + imei + "\";"); | |
Intent intent = this.getIntent(); | |
Uri uri = intent.getData(); | |
if (uri != null) { | |
refer = uri.getQueryParameter("referrer"); | |
super.loadUrl("javascript:window.refer=\"" + refer + "\";"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment