This changes your AIR app (main app’s window) to 100 px by 100 px.
Application.application.width = 100;
Application.application.height = 100;
This changes your AIR app (main app’s window) to 100 px by 100 px.
Application.application.width = 100;
Application.application.height = 100;
1. I am on Ubuntu 8.10 which seems to only support Eclipse 3.2 from Synaptic Package Manager. Since I installed both Eclipse and the IcedTea OpenJDK/JRE from Synaptic, I found out later that Android Dev tool actually needed the Sun JDK in order to use its Layout Editor (otherwise you won’t be able to use Android Layout Editor to edit xml files under res/layout folder. The error was java.awt.font wasn’t found something like that.) What I ended up doing was I uninstalled both Eclipse and IcedTea distribution of JDK (openjdk-6-jdk) from Synaptic, otherwise the newly updated Eclipse will continue to use openjdk which prevented me from using Android Layout Editor.
2. Install Sun’s Java (both jre and jdk).
Every step described in the above article worked for me except I couldn’t get the first step work which was:
sudo apt-get install sun-java6-jdk
apt-get said it could not locate sun-java6-jdk something like that.
So I went with this:
sudo aptitude search sun-java
Which told also me it wasn’t able to find sun-java first time I ran it. But after I did
sudo aptitude
and ->Actions->Update package list
I got to install sun java:
sudo aptitude install sun-java6-jre sun-java6-jdk sun-java6-plugin sun-java6-fonts
I was very happy with aptitude as compared to Synaptic package manager because of the exotic flavor of the former. Besides it seems to be more stable and responsive to me based on my judgement.;)
However, during the adventure, I got confused as to how I could single/full-heartedly accept the license agreement which showed up as a pop up within shell. It turned out I had to maximize the whole thing and scroll down and use TAB key to select “OK” in order to advance.
After all this settled down, I rebooted Ubuntu and made sure that icedTea no longer took over the java world:
java -version
I get
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode)
3. Install and setup Eclipse 3.4.
I manually downloaded Eclipse 3.4 from their site and unzip it into /usr/lib folder. Android dev page recommends Eclipse IDE for Java EE Developers, Eclipse IDE for Java Developers, or Eclipse for RCP/Plug-in Developers.
You may want to temporarily change the owner of the/usr/lib folder to yourself instead of root:
chown <user> /usr/lib
After you are done, go to Eclipse->Help->About Eclipse Platform->Configuration Details, you can see Eclipse is now using the Sun jdk/jre:
java.library.path=/usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/i386:/usr/lib/xulrunner-addons:/usr/lib/xulrunner-addons:/usr/lib/xulrunner-addons:/usr/java/packages/lib/i386:/lib:/usr/lib
java.runtime.name=Java(TM) SE Runtime Environment
java.runtime.version=1.6.0_10-b33
and
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
4. Install Android Development Tool for Eclipse. I personally found/suspected that the http url is faster/more stable(?) than the https one, esp if you are in slow connection. If you are behind some firewall, you may want to set Eclipse’s proxy. Eclispe->Window->Preferences->General->Network Connections->…
5. Configure BASH to export the JAVA_HOME env variable, as well as path to Eclipse like so:
sudo gedit /home/<user>/.bashrc
# ~~~~~~~~~~~~~~~~~ JAVA (JDK,JRE) ~~~~~~~~~~~~~~~~~~~~~
export JAVA_HOME=’/usr/lib/jvm/java-6-sun-1.6.0.10′
export ANDROID_HOME=’/usr/lib/android-sdk-linux_x86-1.5_r2′
PATH=.:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$ANDROID_HOME/tools
alias eclipse=’java -jar /usr/lib/eclipse/startup.jar’
6. (Optional) Configure Eclipse JRE to the one we just installed from Sun. Eclipse->Window->Preferences->Java->Installed JREs->Add->Standard VM->/usr/lib/jvm/java-6-sun-1.6.0.10. And check this new one we just added.
7. You may want to run
Eclipse -clean
if you had some trouble with it during the process.
8. I guess that’s pretty much about it(?)!
9. Have a great weekend/holiday!
I was right after the “Hello World” on google maps. So in order to get MapView, you will need to first have your application target Google API 1.5. Then you would abtain a google maps API for your android application:
1. Generating MD5 Fingerprint of the SDK Debug Certificate . This is under Windows XP:
Hello Android,
I started poking into Android this Monday. I installed Android SDK and Eclipse for JEE developers v3.4.2, following the instructions at the official Android dev site. “Hello Android” went pretty smoothly as I recall except for some minor confusions when I launched the project. I think it was something in regards to the “Android virtual device” but somehow I got thorough. Today when I tried to do the “Notepad” tutorial I got the same error. It was something like this:
“ERROR: Application does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses-library android.test.runner”
I googled this post here which seems to post back when the 1.5pre was out. And it turned out to be much easier with 1.5. So here is the trick.
The problem is that Eclipse doesn’t recoginize the AVD I created under DOS commandline:
android create avd –target 2 –name my_avd
What I did was I clicked the little mobile phone icon (the 16 bit color style somehow reminds me of DOOM II? on DOS) on the toolbar under the menue which says “Opens Android Virtual Device (AVD) Manager” (or alternatively you can go to Window->Android AVD Manager) -> “Create AVD” -> “Finish”.
From then on, the compiler hasn’t complained about the InstrumentationTestRunner.
Scenario: It takes you the whole morning to try to get data in an Excel file into MySQL table. You found out there were special characters such as “5µm” inside it.
Solution: Save the file as .txt (Tab delimited or MS-DOS or Machintosh) and make sure it’s encoded in utf-8, etc.
Steps:
LOAD DATA LOCAL INFILE '/STUFF/Projects/_tmp/reference.txt' INTO TABLE reference
FIELDS TERMINATED BY '\t' ENCLOSED BY '"'
LINES TERMINATED BY '\n';
This is a nice little online tool that allows you to convert *.dbf or *.csv to MySQL “create table/import” statements.
Unlike a List based component, in which scrollbars always appear _inside_ a background image provided you have one, in a mx:Container subclassed component, such as a Canvas, the scrollbars always go _outside_ of your background image.
So say if the Canvas has a width of 200 px, the background image has a width of 200 px when there is no scrollbar. If the scrollbar is 16 pixels wide, the background image would become 200 – 16 = 184 px, as opposed to staying 200px wide. Sort of reminisentant of the DOM box model in IE vs. that in Firebox?
Solution? use nested containers. Say one called “innerBox” and the other “outerBox”:
For “outerBox”, you have full scaled background image and scroll policy to “off“;
For “innerBox”, you have background image set to null and scroll policy to “on“, plus, set both percentage width and percentage height to 100%. You may also want to setbackgroundAttachment to “fixed“;
See the sample CSS below:
.outerbox
{
background-image: Embed(source=”img/gradientPaneBkg.png”,
scaleGridTop=”7″, scaleGridBottom=”96″,
scaleGridLeft=”7″, scaleGridRight=”148″);
background-size: “100%”;
}
.innerbox
{
background-image: null;
vertical-scroll-bar-style-name: “myScrollBarStyle”;
}
.myScrollBarStyle
{
thumbSkin: Embed(source=”assets/scrollThumb_r.png”,
scaleGridLeft=”5″, scaleGridTop=”6″,
scaleGridRight=”7″, scaleGridBottom=”46″);
trackSkin: Embed(source=”assets/null_17_18.png”,
scaleGridLeft=”4″, scaleGridTop=”4″, scaleGridRight=”10″, scaleGridBottom=”170″);
upArrowSkin: Embed(source=”assets/null_17_18.png”);
downArrowSkin: Embed(source=”assets/null_17_18.png”);
}
Now here is the catch: since we have switched off the scrollbar on our component, each time you are are dealing with scrolling, you probably meant to deal with the innerBox’s scrolling. Like so:
override public function set verticalScrollPosition(value:Number):void
{
innerBox.verticalScrollPosition = value;
}
override public function get verticalScrollPosition():Number
{
return innerBox.verticalScrollPosition;
}
I just installed SmartSVN (version 6) today and I am very happy with it so far. It was much easier than I thought when migrating from TortoisSVN. Currently I still have tortoise installed but I probably will ditch it in the future. (Sorry tortoise!) Here are some comparisons (opinions may be inaccurate since this is my first couple of hours of using SmartSVN):
The first three are “thumbs-ups” and the last three are “less satisfactory” (Some customers are never happy, even it’s FREE!):
It seems that mx:Container and subclasses have a style named “backgroundAttachment” which has a value of either “fixed” or “scroll“. “fixed” means the background image (if there is any) will be fixed with regard to the viewport; “scroll” means the background image will scroll with the content (fixed with the content as opposed to the viewport).