Skip to content

Instantly share code, notes, and snippets.

@julianshen
julianshen / gist:780831
Created January 15, 2011 10:49
mkobb.sh result
Creating temporary file...
mkfs.vfat 3.0.7 (24 Dec 2009)unable to get drive geometry, using default 255/63
Copying files:sending incremental file list./a1.pnga1111-0.pnga1111-1.pnga1111-10.pnga1111-11.pnga1111-12.pnga1111-2.pnga1111-3.pnga1111-4.pnga1111-5.pnga1111-6.pnga1111-7.pnga1111-8.pnga1111-9.pngaa11.pngaaa.pngabc.pngbanner.pngcallout.9.pngfoursquare_bigger.pngfslogo.pngicon.pngplurk_icon.pngplurk_icon_36.pngplurk_icon_48.pngppicon.pngseesmic_geo.pngspeak_now.pngspeak_now_popup.png
sent 5167491 bytes received 566 bytes 10336114.00 bytes/sectotal size is 5165169 speedup is 1.00
Successfully created `obbtest.obb'salt for use with obbtool is:5f88a3619e6544ef
mStorageManager = (StorageManager) getSystemService(Service.STORAGE_SERVICE);
mStorageManager.mountObb("/sdcard/obbtest.obb", "android", new OnObbStateChangeListener() {
@Override
public void onObbStateChange(String path, int state) {
Log.d("OBBTEST", ""+path+" mount:"+state);
if(state == OnObbStateChangeListener.MOUNTED) {
String mountedPath = mStorageManager.getMountedObbPath("/sdcard/obbtest.obb");
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<fragment class="com.fm.fragment1.MyFragment"
android:id="@+id/myfrag"
android:layout_width="0dp"
android:layout_weight="1"
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Log.d("FRAG", "onCreateView");
return inflater.inflate(R.layout.mylayout, container);
}
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment class="com.example.android.apis.app.TitlesFragment"
android:id="@+id/titles" android:layout_weight="1"
android:layout_width="0px"
android:layout_height="match_parent" />
/**
* Helper function to show the details of a selected item, either by
* displaying a fragment in-place in the current UI, or starting a
* whole new activity in which it is displayed.
*/
void showDetails(int index) {
mCurCheckPosition = index;
if (mDualPane) {
// We can display everything in-place with fragments.
function getcontentview() {
return R.layout('main');
}
function oncreate() {
log("MyScript", "oncreate called");
textview = findview(R.id("mytext"));
textview.setText("Hello! Javascript!");
}
private void initScriptEnv() {
jsContext = org.mozilla.javascript.Context.enter();
jsContext.setOptimizationLevel(-1);
jsScope = jsContext.initStandardObjects();
Object RObj = org.mozilla.javascript.Context.javaToJS(new Rwrapper(), jsScope);
ScriptableObject.putProperty(jsScope, "R", RObj);
ScriptableObject.putProperty(jsScope, "log", new Log());
ScriptableObject.putProperty(jsScope, "findview", new FindViewById(this));
observer = new FileObserver(this.getCacheDir().getAbsolutePath(), FileObserver.ALL_EVENTS) {
@Override
public void onEvent(int event, String path) {
Log.d("Observer","PATH: " + path +" EVENT: " + event);
}
};
observer.startWatching();
@julianshen
julianshen / gist:1301821
Created October 20, 2011 18:03
sentab1
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Tabs 2</title>
<link rel="stylesheet" href="touch/resources/css/sencha-touch.css" type="text/css">
<script type="text/javascript" src="touch/sencha-touch-all.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body></body>