#Platforms
- 2.3.x Gingerbread
- 4.0.x Ice Cream Sandwich
- 4.1.x/4.2.x/4.3.x Jelly Bean
- 4.4.x Kitkat
- 4.5.x "L"
#Screen Sizes
- "xlarge" screens are at least 960dp x 720dp
- "large" screens are at least 640dp x 480dp
| public class PhonegapWithAdmobActivity extends DroidGap { | |
| private AdView adView; | |
| @Override | |
| public void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| adView = new AdView(this, AdSize.BANNER, PUBLISHER_ID); | |
| super.loadUrl("file:///android_asset/www/index.html"); | |
| ((LinearLayout)appView.getParent()).addView(adView); | |
| adView.loadAd(new AdRequest()); | |
| } |
| import android.media.MediaPlayer; | |
| public class PlayerExample { | |
| MediaPlayer p = null; | |
| private void playSound(String fileName) { | |
| p = new MediaPlayer(); | |
| try { | |
| AssetFileDescriptor afd = ctx.getAssets().openFd(fileName); | |
| p.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength()); | |
| afd.close(); |
| public boolean canRespondToIntent(Context ctx, Intent i) { | |
| PackageManager pm = ctx.getPackageManager(); | |
| List<ResolveInfo> l = pm.queryIntentActivities(i, PackageManager.MATCH_DEFAULT_ONLY); | |
| if (l.size()>0) { | |
| return true; | |
| } else { | |
| return false; | |
| } | |
| } |
| #!/bin/bash | |
| #toggle OSX Finder setting to show the hidden dotfiles | |
| if [ `defaults read com.apple.finder AppleShowAllFiles` -eq 1 ]; then | |
| defaults write com.apple.finder AppleShowAllFiles -bool NO; | |
| else | |
| defaults write com.apple.finder AppleShowAllFiles -bool YES; | |
| fi | |
| killall Finder; |
| ADB_PATH=PATH_TO_ADB | |
| for f in "$@" | |
| do | |
| $ADB_PATH install -r "$f" | |
| done |
| autoload -U compinit | |
| autoload colors | |
| compinit | |
| colors | |
| PS1="%{${fg[green]}%}${USER}@${HOST%%.*}:%~ [%D{%y-%m-%d %H:%m:%S}]%{${reset_color}%} | |
| [%!]%(!.#.$) " | |
| PATH=$PATH:/usr/local/bin/ | |
| alias ls="ls -G" |
| #!/bin/bash | |
| # searches launchd.plist files from launchd directories | |
| grep `launchctl list | grep $1 | cut -f 3` ~/Library/LaunchAgents/* /Library/LaunchAgents/* /Library/LaunchDaemons/* /System/Library/LaunchAgents/* /System/Library/LaunchDaemons/* | cut -d ':' -f 1 | uniq |
| <?php | |
| // CakePHP 2.x database.php file to switch between database configuration settings based on file existence under app/Config directory | |
| /** | |
| * This is core configuration file. | |
| * | |
| * Use it to configure core behaviour of Cake. | |
| * | |
| * PHP 5 | |
| * |
#Platforms
#Screen Sizes