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
$to_search = '{pippo}'; | |
preg_match("/{(.*)}/", $to_search, $result_array); | |
$result_array; // Array with results, string {string} |
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 convertPassMd5(String pass) { | |
String password = null; | |
MessageDigest mdEnc; | |
try { | |
mdEnc = MessageDigest.getInstance("MD5"); | |
mdEnc.update(pass.getBytes(), 0, pass.length()); | |
pass = new BigInteger(1, mdEnc.digest()).toString(16); | |
while (pass.length() < 32) { | |
pass = "0" + pass; | |
} |
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.ACCESS_NETWORK_STATE"/> |
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.WRITE_EXTERNAL_STORAGE" /> |
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.ACCESS_WIFI_STATE"/> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> |
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
Environment.getExternalStorageDirectory(); // something like /sdcard/ |
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
String[] items = { "this", "is", "a", "really" }; | |
ArrayAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, items)); |
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
@Override | |
public void onBackPressed() { | |
if(close_count==1) { | |
Toast.makeText(getApplicationContext(), "Press back again to close application...", Toast.LENGTH_SHORT).show(); | |
close_count--; | |
return; | |
} | |
super.onBackPressed(); |
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
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, | |
Uri.fromParts("mailto","[email protected]", null)); | |
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "EXTRA_SUBJECT"); | |
startActivity(Intent.createChooser(emailIntent, "Send email...")); |
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
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import android.os.Handler; | |
import android.os.Message; | |
import android.util.Log; | |
public class DownloadThread extends Thread { |
OlderNewer