Posts Tagged ‘Android’

MapView with Widgets Android

January 4th, 2010 @ 12:38 am

0

This phased me for quite sometime, how do I use a widget like a button, or a view as an overlay?

I asked on the Google Groups, got a great reply from Mark Murphy, and he explained about how you can use relative layouts to add views on top of the map view and set x, y coordinates and use z ordering.

I started to think about what the MapView was, then a quick look at the API and bam, addView.

(more…)

Tags: , ,
Posted in Uncategorized | No Comments »

Proximity Alerts in Android

January 4th, 2010 @ 12:24 am

1

I’ve spent probably the best part of a couple of days attempting to get Proximity Alerts working in Android. There are a large number of Google Group threads, all leading to essentially someone saying it still doesn’t work. There was one or two that had working solutions, or some who managed to get it working to a certain degree.

I managed to get a working implementation of proximity alerts by combining the information from a number of threads, this is just a guide through what I learnt and should get you up and running with your own alerts.

Just for the record, I need to learn a great deal more about Intent Filters and Broadcast Receivers as my knowledge of them is fairly vague, so please correct me in the comments if I say anything wrong, or should be implementing things differently.

(more…)

Tags: ,
Posted in Uncategorized | 1 Comment »

Android – Handling Screen Rotation

December 30th, 2009 @ 7:31 pm

0

androidLogo

Word of warning before we start, this goes against the standard Android UI and should only be done when you are certain it is appropriate.

To handle screen rotations such that your activity doesn’t get destroyed and restarted do the following:

  1. In your AndroidManifest.xml file go to the Application tab (Assuming you are in Eclipse, Manual programmers can still use this info, but will need to work out the corresponding xml), then under Application Nodes select the Activity you want to stop the rotations on, on the right hand side under “Attributes for <Class Name> (Activity)” scroll down to  Screen Orientation and set it to portrait or landscape.
  2. Then in the same section set config changes to “orientation|keyboardHidden”
  3. Now back in your class add the following function and you’ll be good to go.
// Handle Screen Orientation (Stop Activity being killed and re-started)
@Override
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
}

// Handle Screen Orientation (Stop Activity being killed and re-started)

@Override

public void onConfigurationChanged(Configuration newConfig)

{

super.onConfigurationChanged(newConfig);

}

Tags: ,
Posted in Uncategorized | No Comments »

Google Maps on Android Checklist

December 30th, 2009 @ 5:27 pm

2

Google Maps Logo

Your making an Android app and want to take advantage of Google Maps, you’ve been bashing your head against the desk attempting to work out what is going wrong.

So welcome to this little checklist of things I’ve forgotten to do when doing this task:

  1. Right click on your project in eclipse and go to properties. Then under Android select Google APIs with the correct platform number, click apply then Ok
  2. Open up your Android Manifest file, under the application tab scroll to the bottom and under the Application Nodes click on Add, then double click on “Uses Library”, now for the name enter the following – com.google.android.maps
  3. Your activity which is going to be displaying the map isn’t a plain old activity, it needs to be a MapActivity like: public class MapExample extends MapActivity
  4. Finally your map view in the layout file should look something like <com.google.android.maps.MapView android:id=”@+id/mapview” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:clickable=”true” android:apiKey=”YOUR_API_KEY”/> where your api key can be found by doing as mentioned on the Google Maps site -http://code.google.com/android/maps-api-signup.html

This should get you up and running with lots of mappy goodness.

Tags: , ,
Posted in Uncategorized | 2 Comments »

Android Losing It’s Edge?

December 9th, 2009 @ 11:28 pm

0

androidLogo

After attending one of the Google Developer days in London, I couldn’t help but think that Android is going down a bit of a bad road, taking away some of the simplistic things that made it such a perfect platform to develop for.

So in the good old days of Android, you downloaded a single SDK and everything worked, now you have to download it, and then run an application inside the SDK to install the required versions of code (which actually wasn’t all that obvious to me when I needed a new install of the SDK). But as the day progressed and I got to play with a load of devices, you quickly see that the OS versions on each device become a big problem. (more…)

Tags:
Posted in Uncategorized | No Comments »

Reminder: Installing apps from a webserver

October 30th, 2009 @ 12:23 pm

1

Go to Settings > Applications > Unknown Sources

Then just visit the appropriate link in the Android Browser

Tags: ,
Posted in Uncategorized | 1 Comment »

0

Cyanogen Logo

Yep, that’s right, I said it, iPhone is going to be a winner.

But this isn’t over any hate towards Google, Android, Cyanogen etc. but just more of the fact that Android is at a point of heading down 2 roads. One road leads to Android being fragmented, losing alot of it’s value. The other road leading to a community using different devices but one central set of app’s. I better explain what I’m talking about.

(more…)

Tags: , , , ,
Posted in Uncategorized | No Comments »

Android Unusual Behaviour – Nine Patch PNG’s

September 1st, 2009 @ 10:49 pm

0

I was doing some development on an app and got some weird behaviour where 3 buttons, all of the same background would line up as expected in eclipse and the emulator, but when I inserted a different button in the centre, it messed up when ran on the emulator.

I played around with a number different layouts trying to work out how I was going to fix this, assuming it was just my layout that was playing up. But I got curious and played around with the 9 patch png used for the new button and quickly realised that was the problem. To explain further, compare the left image (The layout shown in eclipse, how I wanted the view to display, and the right is how it displayed when inflated in the emulator [Ignore the button widths - that was me playing around, just look at the heights]).

Where-To-Do Button Eclipse Where-To-Do Emulator Button

(more…)

Tags: , ,
Posted in Uncategorized | No Comments »

1

googleChromeLogo

I just read an article over at linux insider http://www.linuxinsider.com/rsstory/67982.html and it basically discusses the confusion between Android and Chrome OS – My question is, what confusion?

Android in my eyes has always been a mobile phone platform, now I admit mobile phones, smart phones, smart books, its all blurring a bit so my definition of what should be running Android – a device which can be used for making phone calls, has a small screen making full aplications difficult to use, processor and memory (RAM) is limited. Something along those sort of lines. Or devices that don’t necessarily require a full blown OS, something more light weight.

(more…)

Tags: , , ,
Posted in Uncategorized | 1 Comment »