Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Sereri
Sep 30, 2008

awwwrigami

i like tacos posted:

So I'm following the steps on developer.android.com and I can't get past this. It says my Android support library is out of date so I click Install/Upgrade and it doesn't work. It says it fails to create that path. Also when I try to download the extras in the Android SDK it just says access denied. Am I doing something wrong? Is there anything I can do to fix it?




Like any other program the sdk manager can't write to /Program Files unless it is run as admin. You should reinstall the sdk, it installs to AppData nowadays.

Adbot
ADBOT LOVES YOU

Mogomra
Nov 5, 2005

simply having a wonderful time

Sereri posted:

You should reinstall the sdk, it installs to AppData nowadays.

I've been trying to do just that on a fresh install of Windows 7 on and off for the past couple days. The installer refuses to recognize that I have JDK installed.

My PATH variable has "C:/Program Files/Java/jdk1.7.0_07/bin" in it, just for good measure, I've created a JAVA_HOME variable with the same thing. When I'm in any windows command line and I type "java -version" it outputs
code:
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
So what gives? All my searching only gives me results where people say "Add java to your PATH variable" and "create a JAVA_HOME variable."

Is there some issue with JDK 1.7.0_07 and the newest version of ADK? I've never had any trouble installing it before...

Sereri
Sep 30, 2008

awwwrigami

Mogomra posted:

I've been trying to do just that on a fresh install of Windows 7 on and off for the past couple days. The installer refuses to recognize that I have JDK installed.

My PATH variable has "C:/Program Files/Java/jdk1.7.0_07/bin" in it, just for good measure, I've created a JAVA_HOME variable with the same thing. When I'm in any windows command line and I type "java -version" it outputs
code:
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
So what gives? All my searching only gives me results where people say "Add java to your PATH variable" and "create a JAVA_HOME variable."

Is there some issue with JDK 1.7.0_07 and the newest version of ADK? I've never had any trouble installing it before...

Drop the /bin from the path and it should work

Spraynard Kruger
May 8, 2007

Mogomra posted:

I've been trying to do just that on a fresh install of Windows 7 on and off for the past couple days. The installer refuses to recognize that I have JDK installed.

My PATH variable has "C:/Program Files/Java/jdk1.7.0_07/bin" in it, just for good measure, I've created a JAVA_HOME variable with the same thing. When I'm in any windows command line and I type "java -version" it outputs
code:
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
So what gives? All my searching only gives me results where people say "Add java to your PATH variable" and "create a JAVA_HOME variable."

Is there some issue with JDK 1.7.0_07 and the newest version of ADK? I've never had any trouble installing it before...

If this bug is still in the installer with 64-bit Windows, hit Back at the screen where it says it can't find a JDK, then Next and it'll magically find one!

Mogomra
Nov 5, 2005

simply having a wonderful time

Spraynard Kruger posted:

If this bug is still in the installer with 64-bit Windows, hit Back at the screen where it says it can't find a JDK, then Next and it'll magically find one!
I did try that. Didn't help.

Sereri posted:

Drop the /bin from the path and it should work
:negative: That was it. Thanks!

Mr. Crow
May 22, 2008

Snap City mayor for life
This thread doesn't see much activity... is Android that bad to work on or what?

Somewhat related, going to start trying my hand at Android development, is Eclipse + the Plugin the prefered way or is there an IntelliJ equivilent? I use Resharper at work and absolutely love it so I feel comfortable just jumping in and buying it, JetBrains does good work. Not really a point though if it's going to be a huge hassle to work on Android stuff in IntelliJ though.

Mr. Crow fucked around with this message at 20:42 on Sep 28, 2012

Doctor w-rw-rw-
Jun 24, 2008

Mr. Crow posted:

This thread doesn't see much activity... is Android that bad to work on or what?
Yes, if you ask me:

Mr. Crow posted:

Somewhat related, going to start trying my hand at Android development, is Eclipse + the Plugin the prefered way or is there an IntelliJ equivilent? I use Resharper at work and absolutely love it so I feel comfortable just jumping in and buying it, JetBrains does good work. Not really a point though if it's going to be a huge hassle to work on Android stuff in IntelliJ though.

Eclipse + ADT is the only "supported" method, but you can try your hand at IntelliJ. It's a hassle no matter what, anyways.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Mr. Crow posted:

This thread doesn't see much activity... is Android that bad to work on or what?

Somewhat related, going to start trying my hand at Android development, is Eclipse + the Plugin the prefered way or is there an IntelliJ equivilent? I use Resharper at work and absolutely love it so I feel comfortable just jumping in and buying it, JetBrains does good work. Not really a point though if it's going to be a huge hassle to work on Android stuff in IntelliJ though.

Android development isn't wonderful by any means, but I don't think it has anything to do with the activity level in this thread. I mean, it's apparent that Android development is wide-spread, I think its just that there's better resources for getting help a lot of the time.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Thermopyle posted:

Android development isn't wonderful by any means,

I think it's fun :(

Thermopyle posted:

but I don't think it has anything to do with the activity level in this thread. I mean, it's apparent that Android development is wide-spread, I think its just that there's better resources for getting help a lot of the time.

This is my feeling as well. I think the thread is serving its purpose if it is pointing those interested in Android development at decent resources to help solve their problems. I should probably update the OP more often as it seems like useful Android libraries are popping up every week.

Doctor w-rw-rw- your post of horrors gives me a sad. Supporting older OS versions is probably the most frustrating part of Android development.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Glimm posted:

I should probably update the OP more often as it seems like useful Android libraries are popping up every week.

That would be something I'd like to see more posts about. I always miss out on new libraries until they've been out for 2 years or something.

zeekner
Jul 14, 2007

Glimm posted:

Doctor w-rw-rw- your post of horrors gives me a sad. Supporting older OS versions is probably the most frustrating part of Android development.

I especially like this part:

Doctor w-rw-rw- posted:

But yeah. This is Android for you. Years of bullshit you'll never escape, fixes that stare you in the face and tantalize you with their presence only on high version numbers, and compatibility libraries that bridge some of the gap.

Because that sums the whole experience up quite nicely. I'd take Apple's artificial feature segmentation over the very real and disruptive API fragmentation we have now.

Doc, I feel ya. WebView is my white whale, just as VideoView is to you.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Thermopyle posted:

That would be something I'd like to see more posts about. I always miss out on new libraries until they've been out for 2 years or something.

One of the reasons I haven't been posting new libs myself is I haven't had time to really use any of them. In my day job I'm working on iOS and lately I've been too lazy to work on anything in my spare time. But I'll post some things I've seen recently that look neat to me!

Most of these I've found from the #AndroidDev Weekly mailing list, so if you'd rather read about this things directly feel free to subscribe.

Libraries:

The Ultimate Android Library - These guys basically created a site to do what I'm doing here, list a bunch of Android libraries. They put out an example app as well to show them in action. You know it's good because it has the word 'Ultimate' right in the title.

Android Bootstrap - "A template/bootstrap/boilerplate application that includes tons of great open source tools and frameworks" (GitHub link)

Crouton - Cyril Mottier wrote a blog post about his idea of a replacement to Android Toast's and this guy provided an implementation of it. Looks pretty cool, basically context sensitive notifications that are tied to a particular window.

SpongyCastle - Android's Bouncy Castle (security library) isn't quite complete, this lib fills in the missing gaps.

OAK - "OAK is a powerful kit of tools and components to use in your Android project (Compatible with API Level 8+)" (image caching, pinned header list view, section adapter, auto-resizing textview,, encrypted shared prefs, some other stuff).

Undergarment - Slide out menu navigation library. Pretty straight forward, seems to work well.


Tools:

Android Holo Colors Generator - "The Android Holo Colors Generator allows you to easily create Android components such as editext or spinner with your own colours for your Android application. It will generate all necessary nine patch assets plus associated XML drawables and styles which you can copy straight into your project."

j2ObjC - translate Java to Objective-C. Google uses this tool to write their poo poo in Java and then translate to Javascript (with GWT) so they can write some code once in Java for the web, Android, and iOS! Pretty snazzy. Though there are some pretty obvious limitations (specified on the project page).

android-unused-resources - clean up unused resources in an Android project. Hallelujah.

Glimm fucked around with this message at 02:44 on Sep 29, 2012

zeekner
Jul 14, 2007

Glimm posted:

OAK - "OAK is a powerful kit of tools and components to use in your Android project (Compatible with API Level 8+)" (image caching, pinned header list view, section adapter, auto-resizing textview,, encrypted shared prefs, some other stuff).

Definitely going to give this one a try, been looking for a decent image caching solution.

A recommandation for anyone looking to parse HTML, try jSoup, it's pretty nice.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell


Well hot drat. This makes me want to write an app or two. I wish I didn't have a ton of projects going on already.

Doctor w-rw-rw-
Jun 24, 2008
Android-unused-resources is great. However, and without trying to paint the strokes too broadly, I'm going to go out on a limb and say most of us don't use most of these extra libraries if we do Android for a living. Have you tried building an app with lots of libraries? Here's what can happen:

* The apk is positively ginormous. Users bitch, because they want to store apps on their SD card.
** You added a widget or some other crap that disqualifies your app from being moved onto their SD card. Users bitch some more.
* The apk takes forever to build. Your build times are now approaching three minutes, if you build it from eclipse because packing it all into classes.dex takes forever, and it doesn't run proguard on debug releases, so instead of 800 classes your apk will have sixteen THOUSAND. Added Joda-time because you realized how broken Java date/time classes are? Congratulate yourself with another several megabytes!
* You add ActionBarSherlock as a dependency. So far you're still traveling on the beaten path, so it's iffy but everything works.
* You add proguard. It strips too much, but you don't notice immediately, because your apk is now much slimmer (but most users actually didn't notice or care). Your app is broken and you might or might not realize it, depending on how thorough your pre-market-push routine is.
* You added proguard. You decide to upgrade to a newer version which works better.
* You updated proguard, but had to switch to ant to get it to pick up the newer tooling. That's okay, because it's officially supported with the android tool (android update -p blah blah blah). Things seem to work, but you tweaked build.xml.
* Android tools update. You decide to update. Guess what? they changed the directory libraries go in without telling you. It's now libs/ instead of lib/.
* You start getting non-deterministic build failures. Proguard is often to blame. You disable it. You still get non-deterministic build failures, but of a different type and for other reasons. Whatever. You turn Proguard back on.
* You switch to maven. Eclipse hates you.
* You tweak your project so it works, by creating a local maven repository directory structure, which surprisingly, works.
* You add a library. You try updating the project configuration. Eclipse hates you.
* You switch *back* to ant, and just run "ant clean && ant clean && ant clean && ant release". If that errors out, you run "ant release" once more. If that errors, repeat.

Bonus:
* This journey of one and a half years slowly drives you mad, culminating in desperate cries for sympathy in the technical section of an online forum with people likely to understand your pain.
* You realize that yesterday, after work, your mind drifted to Android and you started tearing up without even realizing it.
* You realize that you, over the course of the last three years, have transformed from that cocky developer :smug: into :unsmigghh:

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell


Awesome and accurate-ish. I don't do Android for a living, but I think I've touched all of those problems at least once.

I mostly solve the Android headaches by not caring about anyone not running a new Nexus device!

Doctor w-rw-rw-
Jun 24, 2008

Thermopyle posted:

Awesome and accurate-ish. I don't do Android for a living, but I think I've touched all of those problems at least once.

I mostly solve the Android headaches by not caring about anyone not running a new Nexus device!

Sorry for going nuts, though. I love my company, love its people, and believe in what it's doing (online video streaming), but sometimes I really just feel like I need to find another job. I was hired as an iOS developer, hah. Android work was going to be "temporary", while we were waiting on a couple of external factors.

Anyways, I'm gonna stop now since my Android rage is spent for now (It'll come back quick I'm sure) and work must go on.

The takeaway, though, is that Android is a platform best targeted at hobbyists, large companies, or lifestyle companies - i.e. either scale down the engineering to only handle the latest/easiest platforms or scale up engineering to handle as much as possible. An Android team of one working on a serious app that reaches a lot of people is going to either sacrifice quality or have some brain-breaking problems in all cases.

Doctor w-rw-rw- fucked around with this message at 09:02 on Sep 29, 2012

Glimm
Jul 27, 2005

Time is only gonna pass you by

Doctor w-rw-rw- posted:

Android-unused-resources is great. However, and without trying to paint the strokes too broadly, I'm going to go out on a limb and say most of us don't use most of these extra libraries if we do Android for a living. Have you tried building an app with lots of libraries? Here's what can happen:

Yeah this is definitely something to weigh while creating an app. It's pretty easy to have an empty shell of an app with an apk around 7-10MB.

quote:

* Android tools update. You decide to update. Guess what? they changed the directory libraries go in without telling you. It's now libs/ instead of lib/.

This was annoying as hell.

Geekner posted:

Definitely going to give this one a try, been looking for a decent image caching solution.

I haven't personally used OAK yet so I'm not sure how it handles, but I've used AQuery in the past and it's fantastic. I'd probably try that first unless you're interested in other features OAK provides as well.

zeekner
Jul 14, 2007

Glimm posted:

I haven't personally used OAK yet so I'm not sure how it handles, but I've used AQuery in the past and it's fantastic. I'd probably try that first unless you're interested in other features OAK provides as well.

I already use AQuery for imageviews, but I need something that can provide bitmaps directly. AQuery works great, but it's image code is pretty much focused on ImageViews, so it's hacky to use it for anything else.

zeekner
Jul 14, 2007

I recently did a fresh install of the SDK on a new system, and I gotta say the hardware-accelerated Intel emulator is really loving sweet. I'm able to run Awful with gifs playing at full speed. No extra effort unless you run native code (then you have to add the intel build target).

Just make sure to actually run the HAX installer in the extras folder.

I don't think the actual atom-based devices will catch on very well, but at least Intel put some serious effort into their emulator module.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Geekner posted:

I recently did a fresh install of the SDK on a new system, and I gotta say the hardware-accelerated Intel emulator is really loving sweet. I'm able to run Awful with gifs playing at full speed. No extra effort unless you run native code (then you have to add the intel build target).

Just make sure to actually run the HAX installer in the extras folder.

I don't think the actual atom-based devices will catch on very well, but at least Intel put some serious effort into their emulator module.

Yeah it's pretty awesome. Before an official x86 emulator was around I'd sometimes use the Google TV emulator just to mess with something where the speed wasn't abominable.

In Android news for the day Android's new build system has been officially announced and is at version 0.1, yay!

https://plus.google.com/109385828142935151413/posts/XnW7t9XJCMJ
http://tools.android.com/tech-docs/new-build-system

Xav posted:


I'm happy to announce that the first milestone of our new Android SDK build system is now available to try.

Warning/Disclaimer: this is a (very) early access and is not meant to replace the existing one to ship applications.

We are looking for feedback on the build system and its features.

Current limitations of milestone1 (version 0.1):
  • No support for Renderscript
  • No support of NDK
  • No support for Proguard
  • No Lint integration
  • No emma support
  • JUnit output is only in the console
  • Location of source folders isn't corrently customizable.
  • Binary packaging of library is still going through changes. Do not upload libraries to maven central (or other similar repos) just yet.

Glimm fucked around with this message at 00:02 on Oct 4, 2012

Doctor w-rw-rw-
Jun 24, 2008

Glimm posted:

Yeah it's pretty awesome. Before an official x86 emulator was around I'd sometimes use the Google TV emulator just to mess with something where the speed wasn't abominable.

In Android news for the day Android's new build system has been officially announced and is at version 0.1, yay!

https://plus.google.com/109385828142935151413/posts/XnW7t9XJCMJ
http://tools.android.com/tech-docs/new-build-system

Wow. This is like a laundry list of stuff I needed years ago.

BuildConfig
Product flavors
Binary library projects
Package name overrides
etc.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Interesting post Ferg linked to on Google+:

Reverse Engineering Android: Disassembling Hello World

quote:

When it comes to learning Android, it’s amazing how easy it is to find tutorials, code samples, and documentation to immerse yourself into the world of Android. Interestingly, I’ve found the inverse to be true for the, dare I say, way cooler world of hacking Android. Reverse engineering Android applications can be really fun, and give you a decent knowledge for the inner workings of the Dalvik Virtual Machine. This post will be an all-out, start-to-finish, beginners* tutorial on the tools and practices of reverse engineering Android, through the disassembly and code injection of the Android Hello World application.

CapnAndy
Feb 27, 2004

Some teeth long for ripping, gleaming wet from black dog gums. So you keep your eyes closed at the end. You don't want to see such a mouth up close. before the bite, before its oblivion in the goring of your soft parts, the speckled lips will curl back in a whinny of excitement. You just know it.
I decided to get into Android development and I'm already pretty good at c# and visual studio, so I got MonoDroid. At first glance, it's super neat. But I want that frigging title bar to go away! I did this:
code:
[Activity(Label = "AndroidFirst", MainLauncher = true, Icon = "@drawable/icon")]
public class Activity1 : Activity
{
	int count = 1;

	protected override void OnCreate(Bundle bundle)
	{
		base.OnCreate(bundle);

		// Set our view from the "main" layout resource
		SetContentView(Resource.Layout.Main);

		// Get our button from the layout resource,
		// and attach an event to it
		Button button = FindViewById<Button>(Resource.Id.HelloButton);

		button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };

		this.Window.AddFlags(WindowManagerFlags.Fullscreen);
		this.RequestWindowFeature(WindowFeatures.NoTitle);
	}
}
But it fails, and the only error I get is the extremely unhelpful "Android.Util.AndroidRuntimeException:". The Fullscreen flag was working, it just started being a pain in the rear end when I tried requesting no title. What stupidly basic newbie mistake am I making?

zeekner
Jul 14, 2007

CapnAndy posted:

I decided to get into Android development and I'm already pretty good at c# and visual studio, so I got MonoDroid. At first glance, it's super neat. But I want that frigging title bar to go away! I did this:
code:
[Activity(Label = "AndroidFirst", MainLauncher = true, Icon = "@drawable/icon")]
public class Activity1 : Activity
{
	int count = 1;

	protected override void OnCreate(Bundle bundle)
	{
		base.OnCreate(bundle);

		// Set our view from the "main" layout resource
		SetContentView(Resource.Layout.Main);

		// Get our button from the layout resource,
		// and attach an event to it
		Button button = FindViewById<Button>(Resource.Id.HelloButton);

		button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };

		this.Window.AddFlags(WindowManagerFlags.Fullscreen);
		this.RequestWindowFeature(WindowFeatures.NoTitle);
	}
}
But it fails, and the only error I get is the extremely unhelpful "Android.Util.AndroidRuntimeException:". The Fullscreen flag was working, it just started being a pain in the rear end when I tried requesting no title. What stupidly basic newbie mistake am I making?

You have to add window flags and request window features before you call setContentView, since it takes those flags into consideration when it creates the layout.

Cat Plus Plus
Apr 8, 2011

:frogc00l:
You can use @android:style/Theme.NoTitleBar theme (that Activity attribute seems to have Theme property).

CapnAndy
Feb 27, 2004

Some teeth long for ripping, gleaming wet from black dog gums. So you keep your eyes closed at the end. You don't want to see such a mouth up close. before the bite, before its oblivion in the goring of your soft parts, the speckled lips will curl back in a whinny of excitement. You just know it.

Geekner posted:

You have to add window flags and request window features before you call setContentView, since it takes those flags into consideration when it creates the layout.
Aha, thank you. I have also discovered themes, which are better I think!

PiotrLegnica posted:

You can use @android:style/Theme.NoTitleBar theme (that Activity attribute seems to have Theme property).
It does, and I can set it programatically too. MonoDroid is keen as poo poo.

Ferg
May 6, 2007

Lipstick Apathy

Glimm posted:

Interesting post Ferg linked to on Google+:

Reverse Engineering Android: Disassembling Hello World

I want to spend some time soon digesting this at a level past what the link offers. I was working on a custom JVM language just for kicks to learn more about the JVM a year or so ago. I've been hankering to do the same on Android/Dalvik but I was lazy about finding any good info just to get my feet wet.

duck monster
Dec 15, 2004

I discovered a hack!

If you google bluestacks android app player for the mac, it installs the player but doesnt have a functional app store or way to sideload apps in. Bluestacks instead wants to curate its own small collection of apps.

Wrong! Open up angry birds, go to watch the movie, and it opens up a web browser. Turns out you can side-load apps in from that! It even packages it up nice and neatly in a little .app player.

*This probably works on windows too!*

Apparently theres a way to use bluestacks with the SDK for debugging, but I havent worked that out cos I'm not an android dev. But I can tell you this, the bluestacks app player *murders* the lovely android simulator from the SDK for performance.

Enjoy!

Infomaniac
Jul 3, 2007
Support Cartographers Without Borders
Oops. I had all my projects and example projects duplicated in different folders on my machine, i decided to do a complete delete and reinstall because eclipse was not recognizing them in the project space no matter what- copied them and deleated-probably a Problem with the _meta data-.when i deleted the file through eclipse it deleated across all the folders i thought were bsckups. Too bad, so sad, square one; still fun.

TheReverend
Jun 21, 2005

Has anyone here used the In-app Billing with much success? I admit I'm still pretty new to android and that stuff I've done hasn't been too complicated but this In-app stuff seems like a design disaster. I'd have thought it would have been a whole lot easier!

Is it really this complicated, or do I just suck?

Doctor w-rw-rw-
Jun 24, 2008

TheReverend posted:

Has anyone here used the In-app Billing with much success? I admit I'm still pretty new to android and that stuff I've done hasn't been too complicated but this In-app stuff seems like a design disaster. I'd have thought it would have been a whole lot easier!

Is it really this complicated, or do I just suck?

If Android -> assume design disaster.

I think I dabbled in it once upon a time but didn't get too far into it. If it were me I'd just integrate with Stripe or something.

zeekner
Jul 14, 2007

I keep running into convenience functions that were added in API 8/9/11. I hate spending time re-implementing poo poo that should have existed in API 1.

String.isEmpty() - added in API 9 :wtc:

gently caress.

There should not be twice as many phones with 2.1 than 4.1.

Doctor w-rw-rw-
Jun 24, 2008

Geekner posted:

I keep running into convenience functions that were added in API 8/9/11. I hate spending time re-implementing poo poo that should have existed in API 1.

String.isEmpty() - added in API 9 :wtc:

gently caress.

There should not be twice as many phones with 2.1 than 4.1.
Oh man, String.isEmpty. I remember that one well and my mind instantly went to it before I got through the first sentence.

Why, you ask?

Ask the thousands (tens?) of users who complained. :cripes: I vowed to always test with the lowest API first.

Use TextUtils.isEmpty, btw.

E: link

Doctor w-rw-rw- fucked around with this message at 11:14 on Oct 16, 2012

Flobbster
Feb 17, 2005

"Cadet Kirk, after the way you cheated on the Kobayashi Maru test I oughta punch you in tha face!"
In fairness, you can go straight to the source and blame Java for that one, since they didn't decide that isEmpty() might be useful for strings until 1.6 :wtc:

The current state of fragmentation on Android is ridiculous though. I use Android in my data structures course and I hate that I still have to use 2.2 as my baseline for all the projects because that's what most of my students still have. And it really pisses me off that we bought a batch of Samsung 7" Galaxy Tabs last year for classroom use and we can't even upgrade those (officially) past 2.3.

The only reason I can tolerate programming in Java anymore is because of Android, and I'm excited about when they finally get around to adding lambdas (maybe in Java 8?). But what are the chances I'd be able to use those on Android if I can't upgrade it? Not much, unless their implementation is all compile-time transformations and doesn't require JVM changes.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
I saw a quick mention of Scala in the OP, has anyone had success with using Clojure for Android dev?

Doctor w-rw-rw-
Jun 24, 2008

Flobbster posted:

In fairness, you can go straight to the source and blame Java for that one, since they didn't decide that isEmpty() might be useful for strings until 1.6 :wtc:

The current state of fragmentation on Android is ridiculous though. I use Android in my data structures course and I hate that I still have to use 2.2 as my baseline for all the projects because that's what most of my students still have. And it really pisses me off that we bought a batch of Samsung 7" Galaxy Tabs last year for classroom use and we can't even upgrade those (officially) past 2.3.

The only reason I can tolerate programming in Java anymore is because of Android, and I'm excited about when they finally get around to adding lambdas (maybe in Java 8?). But what are the chances I'd be able to use those on Android if I can't upgrade it? Not much, unless their implementation is all compile-time transformations and doesn't require JVM changes.
The chances are virtually zero regardless. Android implements against a subset of 6 since that's the last freely available release of Java. Building against a newer version of Java seems at this point to be impossible without a huge reconciliation and subsequent licensing deal with Oracle.

Far more likely is some sort of switch to LLVM and something on top of that, IMO, though I find it hard to believe that Dalvik won't continue to be supported indefinitely.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Doctor w-rw-rw- posted:

The chances are virtually zero regardless. Android implements against a subset of 6 since that's the last freely available release of Java. Building against a newer version of Java seems at this point to be impossible without a huge reconciliation and subsequent licensing deal with Oracle.

Far more likely is some sort of switch to LLVM and something on top of that, IMO, though I find it hard to believe that Dalvik won't continue to be supported indefinitely.

It's obviously not impossible to compile other languages to Dalvik, so why couldn't they transition to a different official language? Granted, I'm not sure what that would be* and I didn't realize newer Java versions had to be licensed now. Wonder what that does to OS Java (or JVM-dependant) projects.

*it would be hilarious to watch the corporate tears flow if Google bought xamarin and stated giving that toolchain away. E; Not that they ever would, but still

Munkeymon fucked around with this message at 22:02 on Oct 16, 2012

Doctor w-rw-rw-
Jun 24, 2008

Munkeymon posted:

It's obviously not impossible to compile other languages to Dalvik, so why couldn't they transition to a different official language? Granted, I'm not sure what that would be* and I didn't realize newer Java versions had to be licensed now. Wonder what that does to OS Java (or JVM-dependant) projects.

*it would be hilarious to watch the corporate tears flow if Google bought xamarin and stated giving that toolchain away. E; Not that they ever would, but still
Like Python with its PEPs, Java is extended with JSRs, or Java Specification Requests. These JSRs come with a spec, a reference implementation, and tests for compliance.

These tests in the TCK, or Technology Compatibility Kit, must be passed to certify an implementation as Java™ - that is, the trademark must only be used by certified-compatible implementations.

After Java 6, Oracle locked the TCK down. Basically, only Java distributions substantially derived from OpenJDK may be tested with it, and it also puts field of use restrictions specifically banning implementations on mobile devices. What this means is that Android, with its own VM, and residing on mobile devices, can neither use OpenJDK nor test their own VM against the test suite.

Additionally, the Android classpath was derived from Apache Harmony, an alternative, legal, Apache-licensed Java classpath (implementations of the basic stuff like java.lang.String and other underpinnings of the platform). Apache Harmony went defunct after Apache abandoned the project due to the aforementioned controversy spawned over Oracle's refusal to grant a TCK license.

What this means is that in order to update Dalvik with features found in Java 7+, it must reimplement each feature described in the specification without testing it for strict compatibility. This is *if* the license for the JSR allows them to in the first place, and I highly suspect it does not.

Java 7+ couldn't undo the GPL'ing of the codebase or the Java 6 specifications (also open-sourced), but it did shut out third parties that didn't play ball from certifying that they were in fact Java, thus barring them from using the trademark. The only thing allowing Google to claim Android runs Java is the intermediate step where, briefly, the code is in fact Java, or Java bytecode, runnable on Oracle's JVM, before it is transformed into Dalvik bytecode, which is the abstraction past which Google has never claimed they run Java.

Java 7 is not happening on Android ever, barring another huge legal loophole (Dalvik was designed to be a legal loophole, not just a VM, because it's strictly less capable than the JVM) or an OpenJDK or TCK licensing agreement out of nowhere (unlikely given Oracle's severe butthurt).

Xamarin would also be a plausible solution, especially given XobotOS, and the similarity between Java and C#. Unless Google wants to pour money into an agreement with Oracle, which while unlikely, isn't impossible, it's hard to see the Java language staying up to date on Android. Whether or not Google intends to languish at 99% 1.6 compatibility or take an entirely different approach remains to be seen.

Doctor w-rw-rw- fucked around with this message at 22:50 on Oct 16, 2012

Adbot
ADBOT LOVES YOU

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
Google will buy Xamarin and J# will live again :black101:

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply