This file contains hidden or 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
| var activity = Ti.Android.currentActivity; | |
| var win = Ti.UI.currentWindow; | |
| activity.addEventListener("create", function(e) { | |
| var button = Ti.UI.createButton({title: "Hello world"}); | |
| button.addEventListener("click", function(e) { | |
| activity.finish(); | |
| }); | |
| win.add(button); | |
| }); |
This file contains hidden or 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
| // | |
| // !!WARNING: Not recommended for production code!! | |
| // | |
| public class ClassLoaderActivity extends Activity | |
| { | |
| public void onCreate(Bundle savedInstanceState) | |
| { | |
| // file.jar has a dex'd "classes.dex" entry that you can generate with "dx" from any number of JARs or class files | |
| ClassLoader dexLoader = new DexClassLoader("/path/to/file.jar", getCacheDir().getAbsolutePath(), null, getClassLoader()); | |
| setAPKClassLoader(dexLoader); |
This file contains hidden or 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
| # | |
| # Kill a running Android JDWP (debuggable) process without Eclipse | |
| # | |
| import sys | |
| import socket | |
| import struct | |
| import uuid | |
| import random | |
| import subprocess |
This file contains hidden or 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
| var win = Ti.UI.createWindow({ | |
| backgroundColor: 'white', | |
| top: 0, left: 0, right: 0, bottom: 0, | |
| layout: "vertical" | |
| }); | |
| var button = Ti.UI.createButton({ | |
| title: "click me" | |
| }); | |
| win.add(button); |
This file contains hidden or 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
| SunSpider tests - higher is better | |
| Rhino (Interpreted) | |
| ------------------- | |
| Score: 362 | |
| Richards: 425 | |
| DeltaBlue: 340 | |
| Crypto: 369 | |
| RayTrace: 535 |
This file contains hidden or 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
| #!/bin/bash | |
| # Add this to your ~/.bash_profile | |
| for a in `ls $HOME/.bash_profile.d/*.sh`; do | |
| source $a | |
| done |
This file contains hidden or 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
| marshall@snake:~/Code/test/test_python | |
| $ python test.py | |
| modules = set(['Android', 'Android.Calendar', 'UI', 'UI.Android']), should be: Android, Android.Calendar, UI, UI.Android | |
| methods = set(['UI.Android.createActivity', 'UI.createLabel']), should be: UI.createLabel, UI.Android.createActivity |
This file contains hidden or 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
| var db = Ti.Database.open('/sdcard/test.db'); | |
| var rs = db.execute('SELECT message FROM test'); | |
| if (rs.isValidRow()) { | |
| alert(rs.getFieldByName("message")); | |
| } | |
| rs.close(); | |
| db.close(); |
This file contains hidden or 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 void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.main); | |
| TextView label = (TextView)findViewById(R.id.TextView01); | |
| String dbPath = "/sdcard/test.db"; | |
| SQLiteOpenHelper helper = new SQLiteOpenHelper(this, dbPath, null, 1) { | |
| @Override | |
| public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) { |
This file contains hidden or 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
| LOCAL_PATH := $(call my-dir) | |
| include $(CLEAR_VARS) | |
| LOCAL_MODULE := v8hi | |
| LOCAL_CFLAGS := -I/Users/marshall/Source/v8/include -g | |
| LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -ldl -llog -L$(TARGET_OUT) | |
| LOCAL_SRC_FILES := v8hi.cpp | |
| PRIVATE_WHOLE_STATIC_LIBRARIES := $(TARGET_OUT)/libv8.a |