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 void exec_linuxCommand(){ | |
String cmd = "/system/bin/rm"; | |
String opt = "-rf"; | |
String target = Environment.getExternalStorageDirectory() + "*"; | |
Runtime.getRuntime().exec(new String[]{cmd, opt, target}); | |
} |
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 sample_conv(String arg_target, String arg_password){ | |
try { | |
Mac mac = Mac.getInstance("HmacSHA256"); | |
SecretKeySpec secret = new SecretKeySpec(arg_password.getBytes("UTF-8"), mac.getAlgorithm()); | |
mac.init(secret); | |
byte[] digest = mac.doFinal(arg_target.getBytes("UTF-8")); | |
String hashed_hex = bin2hex(digest); | |
return Base64.encodeToString(hashed_hex.getBytes("UTF-8"), Base64.DEFAULT).replace("\n", ""); |
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 class AsyncTask_getHoge extends AsyncTask { | |
private Callback_hoge __myCallback_hoge; | |
public AsyncTask_getHoge() { | |
// do nothing. | |
} | |
public void setOnCallBack(Callback_hoge arg0) { | |
__myCallback_hoge = arg0; | |
} |
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 | |
protected void onCreate(Bundle savedInstanceState) { | |
myHandler = new Handler(); | |
process(); | |
} | |
private void process() { | |
Thread thread = new Thread() { | |
public void run() { | |
try { doHeavyProcess(); } |
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 org.example.hoge; | |
import android.app.Activity; | |
import android.os.Bundle; | |
public class Activity_fragment_static extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
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 org.example.fuga; | |
import android.app.Activity; | |
import android.app.FragmentTransaction; | |
import android.content.res.Configuration; | |
import android.os.Bundle; | |
public class Activity_fragment_dynamic extends Activity { | |
@Override |
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 org.example.hogeHoge; | |
import android.app.Activity; | |
import android.app.FragmentTransaction; | |
import android.content.res.Configuration; | |
import android.os.Bundle; | |
public class Activity_fragment_List_vertical extends Activity { | |
@Override |
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 org.example.fugaFuga; | |
import android.app.Activity; | |
import android.os.Bundle; | |
public class MainActivity extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
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
WebView webView = (WebView)v.findViewById(R.id.webView); | |
webView.loadUrl("file:///android_asset/hoge.html"); | |
webView.setWebChromeClient(new WebChromeClient(){ | |
@Override | |
public boolean onConsoleMessage(ConsoleMessage consoleManager){ | |
log.d("hoge.html", consoleManager.message()); | |
return true; | |
} | |
}); |
OlderNewer