Category Archives: Code

How to Install your Android APK with One Click

I’ve been learning Corona lately, a tool for building mobile apps. Overall there is a lot of good stuff, though rough around some of the edges especially if you are building “business apps” – you know, anything that isn’t a game. :) But one thing that I really miss from building Android in Eclipse is the auto-install to my Android phone. Here is a way to get 1-click install to your Android device, in Windows.

  1. You’ll need to have the Android SDK installed on your PC. More about that here.
  2. You’ll need to have your Android device plugged in.
  3. You’ll also need to install a freeware app called FileMenuTools – a fabulous tool that I’ve used for years.
  4. Open FileMenuTools and in the top left, click “Add Command”.
  5. In the Properties pane on the lower left, select “Run Program” for your action, for Menu Text I chose “Install on Android“, for icon browse to the SDK Manager.exe because it is an easy Android icon, for Element Types I chose “Only Files“, for Folders I chose “No“, for Files I chose Yes, and for Extensions I typed apk, then for Program you need to browse and find adb.exe in your SDK\program-tools\ directory, and for arguments enter install %FILENAMES%.

Now, if you right click on an APK file that the Corona SDK provides after a build, this should briefly pop up a command window while it copies and installs it to your device.

It will bypass the Install prompts and should show up directly in your Applications folder.

Android Lessons Learned

In the development justice system, the people are represented by two separate yet equally important groups: the staffers who write Android code and the developers who convert this code into apps. These are their stories.

Here is a link to a Google Doc I’m keeping called “Things That Fixed Major Errors in Android“. Its my attempt to stay organized and not make the same mistake twice.

Enjoy!

How to Start a Virtual Machine at Startup Using VirtualBox

This did not seem obvious to me, so I hope it is valuable to someone else. If you are using VirtualBox to host your newly created Virtual Servers, one of the questions you will find yourself asking is: “What if my machine reboots?” VirtualBox does not (yet) have a built in way to indicate that you want to start a VM when your Host machine boots, so you need to add this to your startup.

If you are on Windows, create a batch file with the following content:


@echo off
cls
"C:\Program Files\Sun\VirtualBox\VBoxManage.exe" startvm vm-name
@exit

You should replace “vm-name” with the name of the Virtual Machine you want to start. If you are on XP, make sure you are using TweakUI to auto-login to XP.

Enjoy!

Run a Batch File Invisibly

Running a batch file invisibly can come in handy, especially if you manage computers for other users. It allows you to perform a task without the user knowing anything about it.

Its very simple. Instead of telling the batch file to run, you tell a Visual Basic script to launch the batch file; and Visual Basic has the ability to launch things invisibly.

Follow this demo and you’ll be up and running in just a few seconds

You’ll create two files: the vbs script and a sample batch file

 

Open Notepad, and paste this content, then save the file as invisible.vbs to the Desktop

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\Documents and Settings\%username%\Desktop\1.bat" & Chr(34), 0
Set WshShell = Nothing

 

Open Notepad again, and paste this content, then save the file as 1.bat to the Desktop:

echo hello > "C:\Documents and Settings\%username%\Desktop\1.txt"

 

Now double click on invisible.vbs. You should see a 1.txt file get magically (invisibly) created on the Desktop.

That’s it! Modify to your liking!