Saturday, December 20, 2014
   
Text Size
Login

Android Background Image Resolutions

What?
A reference to what size an image background should be set to for various screen sizes.

Why?
A background image I was using was unedited at 1600x2133 (364kb) and was not displaying on smaller devices. Configuring drawables for each layout seemed to be the only solution.


  1.  res/drawable-ldpi      240x320 
  2.  res/drawable-mdpi      320x480 
  3.  res/drawable-hdpi      480x800 
  4.  res/drawable-xhdpi     640x960 
  5.  res/drawable-xxhdpi    960x1440 
  6.  res/drawable-xxxhdpi   // for launcher only 640dpi 
  7.  res/drawable-tvdpi     1.33*mdpi // not needed as mdpi or hdpi is used 

Android OS: Add GoogleMap as fragment

Applies to:
  • Android Studio (Beta) 0.8.9
  • Android Google Maps v2

What?
A sequel to my article "Basic Android App using Google Maps and Current Location", this article suggests how to add Map as a sub activity. Note that this article is based on a new blank project which does not include code from the previous example but you can still build this over the previous example (as I did).

Why?
The previous article meant that the Google map was your main activity and any other activity would be a sub-activity; returning to the map activity would restart the app as a menu item, it would need to launch a new intent... I wanted to change my previous example so that the homepage of the app (the starting page) will simply display a button to the map (in case of offline mode or incompatibility with the device).

How?
In this example, I'm going to add the map as a fragment. This is the most rudimentary example (display map, move camera and display marker) and can be run from any other activity:

Android: Function to let user take photo or choose existing

What?
A quick article on a function to allow the user to take a photo using their built-in camera or to choose an existing photo from their gallery.

Why?
I wanted both options to be available to the user and for it to replace a displayed image in an ImageView.

How?

Android: Replace return key with done, go, send...

What?
A quick article on how to replace the return key on a soft keyboard (software based) on a touch-device.

Why?
I have an editText where a user can enter any text value but if they typed a return character, the app would crash because it didn't understand the data. I tried replacing the new lines but just stopping the return key or trying to catch it is an obsolete method.

How?

Android: Keytool and Google Maps displaying grey

Applies To:
  • Microsoft Windows 7 Pro
  • Android Studio v0.8.6 beta
  • Java Development Kit v1.8.0_20

What?
The article below serves as a checklist to ensure I don't release an app that only displays maps to myself (again).

Why?
This took me a while to figure out so hopefully this will help others.

How?
The gist is that I was using the Test SHA1 when adding allowed Android Keys to the Google APIs console (there's so many) when I should be using the App SHA1 (I have now added both to the console).

Latest Posts

  • Basic Android App using Google Maps and Current Location

    • Wed 17-Dec-14
      Is that how it's spelt? setContentVie( "View". If not try going to build and "clean project". Also ...
      Joel L.  
    • Tue 16-Dec-14
      I have problem in "cannot resolved R" " setContentVie(R .layout.activit y_maps);" :cry: How to solve ...
      LucasR
  • Migrate Joomla! 1.5.x to 2.5.x+

    • Thu 18-Dec-14
      Interesting report LLiSEIL! I'll definitely have to review it when Joomla 3.5 comes out. Error 1: is ...
      Joel L.  
    • Tue 16-Dec-14
      * Categories: - duplicates, I suppose from the multiple times I launched the script. - love the notes ...
      LLiSEIL  
    • Tue 16-Dec-14
      SQL ERror 3 > -- Step 2) Import articles from J15 and insert as articles in J30 INSERT INTO `newbase_j25`.d ...
      LLiSEIL