I posted a message here lamenting that runtime Annotations aren’t supported and that I couldn’t find a place to submit bug reports/feature requests. In any case I was hoping to use runtime Annotations for my StateMachine class but I guess I’ll try source only.
December 8, 2007
December 7, 2007
Android – application debug logging
Here and Here are a couple of places that got me started. First the standard java logging mechanism doesn’t work. In addition System.out.print doesn’t work. You need to use the android.util.log.
package com.saville.tests;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
@StateMachine
public class test extends Activity
{
/** Called with the activity is first created. */
@Override
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
Log.v(TAG, "onCreate: E");
setContentView(R.layout.main);
Log.v(TAG, "onCreate: X");
}
private static final String TAG = "test";
}
The Log class supports various levels (VERBOSE, DEBUG, INFO, WARN, ERROR, ASSERT) the low-level routine is Log.println(int priority, String tag, String msg). But typically the v, d, i, w, e and a convince routines would be used. So that’s half the game, the other half is to be able to see the output. For that you use “logcat”. In Eclipse if you goto menu “Window/Show View/other/Android/logcat” or if your in the Debug perspective it will be in “Window/Show View/logcat”. Apparently, its not very reliable in Eclipse and executing:
adb logcat
Allows you to see it from a command line, but in Eclipse the log also includes a Date stamp which makes it nice. I was able to get the Eclipse/logcat going by closing than reopening. Of course you mileage may very:) If you look at the links above it appears you can use ddms, but I haven’t used that yet.
December 6, 2007
Android – adding busybox
Not using eclipse and removing an Android app
As a test I followed the instructions here, to test how easy it was to not use eclipse. It wasn’t hard at all except for figuring out how to remove an app. First I put the <andriod_sdk>/tools directory on my path so the tools were easily accessible (<android_sdk> respresents the full path to where I install the sdk). Since I had already installed one app, when using eclipse, and the second app I installed had the same name I didn’t know which app was running. I snooped around the debugger, adb, and saw that there was a shell command:
adb shell
I then used the ls command and found data/com.saville.tests and deleted it but the app was still there. While playing with the emulator I also found the the right most icon (yellow folder icon) on the home page (press the house button on the emulator), was the “Applications” folder where applications can be run.
Another important location was the “Dev Tools” icon, which is the silver folder icon with the gear on the right. Here I found by navigating to “Dev Tools/Package Browser/com.saville.tests” I saw that the “Source” of my app was in /data/app/test1.apk. I deleted that and bye-bye test1 from the “Applications” folder.
Further more if I deleted the /data/data/com.saville.tests the information in “Dev Tools/Package Browser” disappeared.
How to create a New Android Project
I installed Android and then tried to follow the instructions on how to develop a new application here. I tried Create new project in workspace and added the ‘test1′ to “Project name:”, then tabbed to “Package name:”. At the top of the dialog the help line said; “Package name must be specified”. I typed a character, the help line said; “Package name must have at least tw o identifiers.”. If I then type two identifiers “a b” it says; “‘a b’ is not a valid java identifier”.
I wasn’t making much progress, I then googled around and found this, so the Package name must be a reverse DNS type name of two identifiers. So I used ‘com.saville’. The the help line changed to, “Activity name must be specified.”, I added “test1″ to Activity name: and pressed Finnish.
This created the project file in /home/wink/workspace/test1 with assets/ bin/ res/ and src/ and AndroidManifest.xml plus a bunch of other files in the subdirectories. In particular the source is in test1/src/com/saville/test1.java along with R.java.
After that far, I asked my self; how do I print out “hello, world”? The HelloActivity in the samples seem to be missing the R.java file. Anyway I googled for <android hello world> and found this.
December 2, 2007
Debugging initialization of Firefox extensions
That worked beautifully, I wanted to set a break point
on the first line of my code that executed after it loaded.
I ran:
firefox -chrome chrome://venkman/content
and then did “window.open()” my code loaded and I
set a future breakpoint on the first statement in the file.
I then checked “Save Break/Watch Settings On Exit” in
the file menu and then exited firefox.
I’d like to thank Alex Vincent for solving the mystry on how to debug a the initialization/loading of a Firefox extension. Earlier I had a problem concerning why my Firefox extension would not work on the Mac. My attempts to debug that led me to want to use a debugger to watch how my extension worked as it was loaded, but I couldn’t figure out a solution. So I posted a message to the Mozilla developer forums javaScript Debugger email list.
The solution was provided by Alex Vincent, which was to not use the -venkman option but instead execute using -chrome below is the last message I posted this subject which details the solution:
That worked beautifully, I wanted to set a break point
on the first line of my code that executed after it loaded,
so I ran:firefox -chrome chrome://venkman/content
and then executed “window.open()” as you suggested.
My code loaded and I set a future breakpoint on the
first statement in the file. I then checked
“Save Break/Watch Settings On Exit” in
the file menu and then exited firefox.I then ran a second time with the same command:
firefox -chrome chrome://venkman/content
Then did “window.open()” a second time and we dropped
back into the debugger at my break point at the top of
the file. This was exactly what I wanted.This is exactly what I wanted, hopefully this helps
someone else in the future.THANKS Alex!
Wink
Getting GEFORCE 7600 working on Ubuntu 7.10
I had a heck of a time trying to get this to work every time I tried to enable the restricted driver so I could run the enhanced UI all that would happen when rebooting is I’d get a message indicating that we were going to use Low-Resolution.
Things got disparate when I brought my two Dell’s from NXP home and wanted to hook them up to my linux box. So I searched the net and ran across Alberto Milone’s Envy package. To get the enhanced UI going I needed to install xserver-xgl.
sudo apt-get install xserver-xgl
This was found when executing compiz from the command line and an error is seen “Xgl: not present”. After installing I still have a couple of complaints; first X thinks the display is 3200×1600 and tends to put things in the middle of the display. Secondly, the menu bars at the top and bottom extend across both screens. On windows the system understands that there are two screens and it works better.