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
// launches the settings screen that lets user turn on gps radio | |
private void launchGPSOptions() { | |
final ComponentName toLaunch = new ComponentName("com.android.settings","com.android.settings.SecuritySettings"); | |
final Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); | |
intent.addCategory(Intent.CATEGORY_LAUNCHER); | |
intent.setComponent(toLaunch); | |
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
startActivityForResult(intent, 0); | |
} |
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
// launches the settings screen that lets user turn on gps radio | |
private void launchGPSOptions() { | |
final ComponentName toLaunch = new ComponentName("com.android.settings","com.android.settings.SecuritySettings"); | |
final Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); | |
intent.addCategory(Intent.CATEGORY_LAUNCHER); | |
intent.setComponent(toLaunch); | |
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
startActivityForResult(intent, 0); | |
} |
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
// put this in your activity | |
@Override | |
protected Dialog onCreateDialog(int id) { | |
if(id == ID_DIALOG_VALIDATE){ | |
ProgressDialog registerDialog = new ProgressDialog(this); | |
registerDialog.setMessage(getString(R.string.alert_registering_phone)); | |
registerDialog.setIndeterminate(true); | |
registerDialog.setCancelable(true); | |
return registerDialog; |
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
Android Debug Bridge | |
ADB quickview | |
* Manage the state of an emulator or device | |
* Run shell commands on a device | |
* Manage port forwarding on an emulator or device | |
* Copy files to/from an emulator or device | |
In this document |
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
// launches the settings screen that lets user turn on gps radio | |
private void launchGPSOptions() { | |
final ComponentName toLaunch = new ComponentName("com.android.settings","com.android.settings.SecuritySettings"); | |
final Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); | |
intent.addCategory(Intent.CATEGORY_LAUNCHER); | |
intent.setComponent(toLaunch); | |
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
startActivityForResult(intent, 0); | |
} |
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 static String bytesToHex(byte[] data) { | |
if (data==null) { | |
return null; | |
} else { | |
int len = data.length; | |
String str = ""; | |
for (int i=0; i<len; i++) { | |
if ((data[i]&0xFF)<16) { | |
str = str + "0" + java.lang.Integer.toHexString(data[i]&0xFF); | |
} else { |
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.mysite.aes; | |
import javax.crypto.*; | |
import javax.crypto.spec.*; | |
public class AES { | |
static String key = "Z7Y74jNe43F3o15T"; // must be 16-bytes | |
static String iv = "P0LrHf3nkBo7z46f"; | |
public static String Encrypt(String stringToEncrypt) { |
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 writeToSDCard() { | |
try { | |
File root = Environment.getExternalStorageDirectory(); | |
if (root.canWrite()){ | |
InputStream from = myContext.getResources().openRawResource(rID); | |
File dir = new java.io.File (root, "pdf"); | |
dir.mkdir(); | |
File writeTo = new File(root, "pdf/" + attachmentName); | |
FileOutputStream to = new FileOutputStream(writeTo); |
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 writeToSDCard() { | |
try { | |
File root = Environment.getExternalStorageDirectory(); | |
if (root.canWrite()){ | |
InputStream from = myContext.getResources().openRawResource(rID); | |
File dir = new java.io.File (root, "pdf"); | |
dir.mkdir(); | |
File writeTo = new File(root, "pdf/" + attachmentName); | |
FileOutputStream to = new FileOutputStream(writeTo); |
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
CGRect imageFrame = CGRectZero; | |
imageFrame.size.height = 150; | |
imageFrame.size.width = 200; | |
imageFrame.origin.x = 59; | |
imageFrame.origin.y = 20; | |
UIImageView *imageView = [[UIImageView alloc] initWithFrame:imageFrame]; | |
imageView.image = [UIImage imageNamed:@"tomatoes.jpg"]; | |
[self.tableView.tableHeaderView addSubview:imageView]; | |
[imageView release]; |
OlderNewer