I was doing random searching today about Android View implementations -- which is, I assume, how a lot custom graphic UI are being built in Android.
While this blog The Android Competency Center did not help me with my question, I do feel much more competent with Android after having read the archives.
http://www.androidcompetencycenter.com/
Good Luck with Your Projects!
Development blog discussing configuring, building, and managing software. Including coverage of Debian Linux, .NET development projects, Perl and development tools
Saturday, July 17, 2010
Thursday, July 08, 2010
Understanding Android Applications -- Start with the Manifest
One of the most important files in an Android Application is the application manifest.
Understanding the application manifest's format is critical for any application developer.
Read more about the Android Application Manifest File Format Here:
http://developer.android.com/guide/topics/manifest/manifest-intro.html
Understanding the application manifest's format is critical for any application developer.
Read more about the Android Application Manifest File Format Here:
http://developer.android.com/guide/topics/manifest/manifest-intro.html
MapView Google Development Tutorial Context Bugs
There are some bugs in the code that Google supplies to demonstrate the Google Maps API.
The original Google Tutorial is here:
http://developer.android.com/resources/tutorials/views/hello-mapview.html
There is a useful Google Groups post regarding the major bug / confusion with this tutorial:
http://groups.google.com/group/android-beginners/browse_thread/thread/9d175c71b8b6825d
The differences are shown below
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
List mapOverlays = mapView.getOverlays();
Drawable drawable = this.getResources().getDrawable(R.drawable.dot_bar);
DefaultItemizedOverlay itemizedoverlay = new DefaultItemizedOverlay(drawable,this);
GeoPoint point = new GeoPoint(19240000,-99120000);
OverlayItem overlayitem = new OverlayItem(point, "Hola, Mundo!", "I'm in Mexico City!");
itemizedoverlay.addOverlay(overlayitem);
itemizedoverlay.ReadyOverlay();
mapOverlays.add(itemizedoverlay);
}
}
Changing the code in onCreate to supply 'this' as a Context for the ItemizedOverLay is critical, otherwise you will get a NullReferenceException on the mContext field when onTap(int) attempts to create a Alert Dialog.
The original Google Tutorial is here:
http://developer.android.com/resources/tutorials/views/hello-mapview.html
There is a useful Google Groups post regarding the major bug / confusion with this tutorial:
http://groups.google.com/group/android-beginners/browse_thread/thread/9d175c71b8b6825d
The differences are shown below
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
List
Drawable drawable = this.getResources().getDrawable(R.drawable.dot_bar);
DefaultItemizedOverlay itemizedoverlay = new DefaultItemizedOverlay(drawable,this);
GeoPoint point = new GeoPoint(19240000,-99120000);
OverlayItem overlayitem = new OverlayItem(point, "Hola, Mundo!", "I'm in Mexico City!");
itemizedoverlay.addOverlay(overlayitem);
itemizedoverlay.ReadyOverlay();
mapOverlays.add(itemizedoverlay);
}
}
Changing the code in onCreate to supply 'this' as a Context for the ItemizedOverLay is critical, otherwise you will get a NullReferenceException on the mContext field when onTap(int) attempts to create a Alert Dialog.
Wednesday, July 07, 2010
Google Android Development "Hello, Views" and Tips for API 7
final CheckBox checkbox = (CheckBox) findViewById(R.id.checkbox);
checkbox.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// Perform action on clicks, depending on whether it's now
// checked
if (((CheckBox) v).isChecked()) {
Toast.makeText(HelloFormStuff.this, "Selected",
Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getApplicationContext(), "Not selected",
Toast.LENGTH_SHORT).show();
}
}
});
The text in Green Worked for me, the text in Red did not work for me.
checkbox.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// Perform action on clicks, depending on whether it's now
// checked
if (((CheckBox) v).isChecked()) {
Toast.makeText(HelloFormStuff.this, "Selected",
Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getApplicationContext(), "Not selected",
Toast.LENGTH_SHORT).show();
}
}
});
The text in Green Worked for me, the text in Red did not work for me.
Google Android Development "Hello, Views" and New Eclipse Project Template
I have been working on the Google Android Development samples located here:
http://developer.android.com/resources/tutorials/views/index.html
This is the "Android Views" tutorials/example code and I have been reading and trying out the examples and various modifications.
One thing that I have noticed is that the Tutorials all refer to "res/drawable" as if it was a single folder. Does that mean that the tutorials were created before Android 1.5 allowed drawable to be a three part folder structure?
Does anyone have a clear best practice (I did Google) for where to put your icons and if you want to make different copies or just included them all in ldpi?
http://developer.android.com/resources/tutorials/views/index.html
This is the "Android Views" tutorials/example code and I have been reading and trying out the examples and various modifications.
One thing that I have noticed is that the Tutorials all refer to "res/drawable" as if it was a single folder. Does that mean that the tutorials were created before Android 1.5 allowed drawable to be a three part folder structure?
Does anyone have a clear best practice (I did Google) for where to put your icons and if you want to make different copies or just included them all in ldpi?
Friday, July 02, 2010
HTC Evo Android Tips, Tricks and Setup Guide Links
I am a new owner of an Android Phone (a Sprint phone, the HTC Evo, to be exact) and as a new Android user I have been reading tons of how-to and setup documents.
Here is a great post on a popular forum that some people have done major work to collect, edit and post.
The Good
The Bad
This one does not bother me but it seems like a miss... But I like the robot!
The Ugly
I hate this problem, and I'm sad to see that it is a universal one...
Here is a great post on a popular forum that some people have done major work to collect, edit and post.
The Good
D. When your phone is ringing, if you flip it over, it will silence the ringer.
C. If you want to change the default action that occurs when you select a contact from the Favorites widget: (Thanks Companyman)
1. Go into the People application and select your contact
2. Click on the Menu button near the bottom of your phone
3. Select the "More" option
4. Click on the "Set widget action"
5. Select whatever action you want.
The Bad
This one does not bother me but it seems like a miss... But I like the robot!
Q. Does anyone know how to turn off/change the "green Android Robot" picture that pops up when you're trying to make a phone call?
A. The way to change the Android pic is to assigned the person your calling a picture in your contacts. If the number is not from a contact then I am afraid you are stuck with the little green monster unless you root and someone builds a rom without him.
The Ugly
I hate this problem, and I'm sad to see that it is a universal one...
Q. When sending text messages, is there a way to send the text from the message window without having to hit the button to make the keyboard disappear and then hit the send button?This is also pretty unfortunate...
A. The send button should be to the right of the text window even if the keyboard is up, at least in Portrait mode. In Landscape you either have to hit menu and send or just minimize the keyboard.
Q. Is it possible to have a different wallpaper on the lockscreen from your home screen?For more details, read the full article here: http://androidforums.com/tips-tricks-evo-4g/90404-tip-how-do-i-settings-android.html
A. Seems that is not available in this build of 2.1. In others I have used you could. If you or anyone else finds this to not be true let me know. As of right now it seems the same wallpaper for the home screen works for the lock screen as well.
Subscribe to:
Posts (Atom)