My First Android Widget

Posted by DesertFox on Nov. 6, 2010, 10:52 p.m.

So I got me an Android phone. Samsung Epic, to be specific. This is the first phone that I've ever had that was in fact worth having. So it is awesome.

Whats more is now I can screw around with the Android SDK. It turns out that Android apps are written in Java! Finally, Java being used for something other than the butt of programming jokes.

Anyhow, considering that A) I don't know anything about the Android SDK really and B) I haven't touched java in like… 4 years… I managed to make a widget.

So what is this widget?

It is a single button. It says "SALAMI". It does nothing when you press it. Impressive, no?

Actually, yeah. Android SDK is strangely complicated with its funny architecture, and even getting a button to display involved editing manifest files, layout XML files, and a bunch of other stuff. Android loves its XML.

I probably ought to have done the Android version of Hello World! first. Eh, who cares. Now I've got a SALAMI button on my home screen. I think I'll turn it into a Press Button Receive Bacon widget, normally showing a random picture of delicious bacon, but sometimes showing a picture of Kevin Bacon instead.

Comments

Ferret 13 years, 11 months ago

Those phones always sounded really cool, but after having a smart phone myself (though a fat palm) I realized that all I did was call and text and didn't need to be paying for emails or anything like that. So I switched to a free phone with a full keyboard but only does calls and texts (it does have web but it's disabled).

That just my opinion but I'm happy with it.

(though it would be cool to have a device that I could carry around and develop things for)

DesertFox 13 years, 11 months ago

Well, I've always been interested in development for mobile devices, and I figure buying an Android phone is cheaper than buying a Mac and a new iPod Touch. I can safely say that if I develop something on the Android, I could probably port it to the iPhone without *too* much trouble.

Sure you can always develop for the PC, but invariably it just ends up gathering dust. There is just something about seeing the results on a device in your hands. Plus multi-touch is awesome.

NeutralReiddHotel 13 years, 11 months ago

Quote:
Sure you can always develop for the PC, but invariably it just ends up gathering dust. There is just something about seeing the results on a device in your hands. Plus multi-touch is awesome.

I always wondered what that's like. Would you recommend an Android to start developing applications/games in? (considering I would have to learn Java first, but I wouldn't know how else I could get into mobile development)

DesertFox 13 years, 11 months ago

Well Java is ridiculously easy to learn in my opinion. It would be a bit more difficult to learn if you don't have programing experience outside of Game Maker. I have to say, the android SDK seems a bit convoluted at the start but I expect that I'll get used to it after I actually read up on it.

The iphone sdk was easy in comparison, but I just got started so I can't really say for sure.

One way or the other, I wouldn't suggest diving into mobile development unless you know what you are doing, or are prepared for some studying. That is up to you.

As far as a specific development device, I really, can't say. Go for something relatively recent with multi-touch capability or else you miss out on a very large part of current mobile devices.

NeutralReiddHotel 13 years, 11 months ago

Well, the reason I bring it up is because I want to start moving away from Game Maker, and mobile development always interested me. I do have an iPod touch, but not a Mac to develop in. Would you recommend the Android as a phone? Regardless of development I mean lol I'm getting a new phone in a few months.

KaBob799 13 years, 11 months ago

Java isn't too big of a step up from GM, I had no trouble learning it compared to the rest of my class.

Astryl 13 years, 11 months ago

Quote:
Java being used for something other than the butt of programming jokes

It wasn't used as the butt of programming jokes…

It is the butt of programming.

Anyway good luck with the Android SDK, I tried it a month ago. Got bored with it shortly after I began.

Castypher 13 years, 11 months ago

Java is hella easy. But like people pointed out, it's not the most respected language. I think C++ is much more widely used (new to the programming world, don't flame me). Fortunately, it's very similar to Java, except Java has more of a safety net.

As for C#, I hear it's more of an indie game development language than a commercial. That makes me sad.

sirxemic 13 years, 11 months ago

Quote:
Java isn't too big of a step up from GM, I had no trouble learning it compared to the rest of my class.
Do not compare it to GM '>_> I find it annoying when people say something like that. You had no trouble learning it because you have programming experience, not because you have GM experience. =P

KaBob799 13 years, 11 months ago

How can I say whether it's harder/easier than GM without using a comparison?