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

Castypher 14 years, 1 month ago

GM follows most of the basic programming rules. Working in GM is similar to working in Java and C++ (though the object oriented bit is very watered down). So why not compare?

sirxemic 14 years, 1 month ago

Quote:
How can I say whether it's harder/easier than GM without using a comparison?
You weren't anyways. My point is that when a programming language is easy to learn, it's most likely because of programming experience, not just of experience with one specific language.

KaBob799 14 years, 1 month ago

Quote:
Java isn't too big of a step up from GM

But yes, knowing any programming language makes it easier to learn others and the more similar those languages are the easier it is.

Ferret 14 years, 1 month ago

I think when I learned object oriented programming (I believe it was java first) for the first time I think gm really helped me out by giving me some experience before hand.

Castypher 14 years, 1 month ago

Having just really gained an understanding of OOP (thanks for trying, Ludamad, but you talk like Serprex), I have to say that, like Ferret, the object-oriented ideas presented in GM helped me grasp OOP a little sooner.

Not to say I haven't had much OOP beforehand. But I'd certainly not tried it in anything like Java until this month. Yes, I'm behind.

Josea 14 years, 1 month ago

GM definitely makes it easier to understand OOP. Back in my algorithms II course my friends struggled understanding the concept of objects, while it was a breeze for me. Then again, everything at uni has been a breeze for me.

Alert Games 14 years, 1 month ago

I agree. After learning GM around 8-9th grade, everything else that im taking now I can grasp fairly easily after only a little effort.

but i still use GM because its easier and faster to use for games :>

tylerthemiler 14 years, 1 month ago

Yeah, Android is kinda weird at first. I just got a G2. Emulators are amazing. I've been playing some pokemon and FF7. Its basically a gaming platform.

Too bad java is dying atm…