Thoughts on Oracle v Google stuff

Or more specifically after parsing this, thanks Noles ;).

Personally, I think under that context, Oracle will likely win.  I do not believe that a language /should/ be copyrighted but that they technically can be, think about how the types involved might mix for various copyrighted works.

I’ll be the first to admit that our system for copyright, patents, intellectual property, trademarks, and the like is a maze with more than a few turns just full of bullshit. But let’s think a moment: what is it really about? Money. It’s not about fostering innovation (patents) or controlling your property (oi). It’s about money. That’s it, simple.

Java is a product and a creative work, sufficient to be copyrighted. So is the GNU Compiler Collection and that last book you read.

What is the jist of copyright? Wikipedia as of this writing, defines it as a sub class of Intellectual Property that is generally “the right to copy, but also gives the copyright holder the right to be credited for the work, to determine who may adapt the work to other forms, who may perform the work, who may financially benefit from it, and other related rights”

Java, as it applies to Android, is not very different than any other language applied to other systems. The devil is in the details as they say. An Android application is a collection of Dalvik bytecode, native code, and resources running under the Dalvik virtual machine: and Android provides a runtime.

The implementation is not “Java” as Oracle ships it. In fact, as Microsoft’s various efforts to make a .NET dialect of C++ and projects like JRuby confirm: you can have a fair bit of abstraction between *concept* and implementation. Android developers typically write code in Java to an interface documented in Java. They could just as easily write in any language you can eventually wrangle into Dalvik bytecode! Android applications can and have been written in other JVM languages, and non JVM languages. The interface, well hell, many things in the .NET world are done in C# but you could just as easily use Visual Basic or F#. Really helps to be able to read C# though. Just like how on many systems, it helps to be able to read C and or C++.

That runtime part that Android applications depend on is quite “Java like”. Many intrinsic components are provided. C programmer’s should think of the stdio library. Because that is the sort of thing that has been “Copied” from “Java”. Essential programming interfaces, not implementations but interfaces (as far as Oracle holds right to). GNU implements C’s I/O library in their runtime. So does Microsoft in their own. They didn’t have to supply crap like printf() and puts(), they could’ve supplied their own pf() and IoConsolePutLStr() functions! Nether group owes the other jack shit over that. But hey, printf() and puts() are what are widely used: even in other languages!!!!

A lot of things in Androids runtime are also unique. For example, the parts that make it Android specific rather than able to compile under Oracles development kits for PC. The implementation is not copied but the conceptual interface, yes.

So that’s a problemo, how far does that level of control and ownership apply to derivatives? And what actually constitutes a derivative work?

Is copying the script of a movie scene for scene, line for line, and reshooting it for your own release and profit, an issue? Yeah. Obvious. Is doing a movie about a train, going to allow whoever owns copyright on some other movie with a train, to sue your ass for it? It shouldn’t unless it’s close enough to the former, or similarly having a legal problem of some other sort.

It’s more of a question like, should Matz and Oracle be able to sue the developers of JRuby for copyright infridgement: because it provides an even stronger resemblance to both Ruby’s and Java’s programming interfaces than Android’s runtime does to Java’s. Things like C, C++, C#, Common Lisp, Scheme, and EmcaScript are formally standardized to some extent. Things like Java, Python, Perl, Ruby, and Lua are not. Could Niklaus Wirth (or Apple) have sued Boreland over Delphi?

I do not feel that it is responsible to exercise such strong-arm aggression against users. It’s bad for Java, it’s bad for business, it’s bad for the continuing evolution of the industry, and it’s bad for those who have already invested.

And as far as I am concerned, enough programming languages “Borrow” stuff that applications of copyright the way Oracle must be seeking, or not feasible—and may very well fuck up language development for the next decade. Now we have to worry what the fuck we name our classes? What next, companies are going to start exerting control over _our_ works made with their tools?

Thanks Oracle, hope your stock plummets and your employees find good jobs with businesses that offer better job security.

Titanium Backup + Dropbox HOWTO

I set this up today at long last (and assume most of it will apply to Box as well). Couldn’t find much use on how to actually make it sync, so here is a picture!

Go into your Preferences -> Cloud sync settings; and enable dropbox. You can go into Dropbox Settings to control stuff like what to sync and where to sync, etc. Then go to the “Schedules” tab and voila!

I don’t see what is so schedule about that, and I seem to remember reading that you have to do sync’s manually rather than on a schedule but whatever. Couldn’t find crap on Google, so I took a screenie ^_^.

Contemplating mutiny from Amazon to Google

Back in August, I rambled a bit about my thoughts on electronic books. Later on I acquired an Android tablet; about 4 x as much as a Kindle for the make/model tablet I purchased, but a hell of a lot more useful than a kindle or my netbook.

Since then, I have more or less established myself with getting books via Amazon. In fact, it’s the only setup I’ve been using these past few months. I like it and my only complaint is I find wish-list issues more useful from a real web browser. Since then the Cloud Reader has become widely available, so Linux/BSD issues are even pretty moot now. I like Amazon and use it for plenty but they may have just lost a customer.
Today I clicked through references to Amazon and Google Play and became angry.
Now Amazon rarely makes me angry, the worst they’ve ever done is hook me up with a seller that bungles tracking data, but hey, packages still got there and it was small stuff. So far as long as I don’t have to work for Amazon, it’s a good enough thing in my books. Up to now, if a competitor would offer a lower price: I would still buy the Kindle version, in order to keep consistency and not have to remember which app/platform I bought it from.  It also sometimes pisses me off that books I want are not always available in a Kindle edition, but that makes me upset with publishers, not Amazon! The price difference of $58.28@Amazon versus $69.42@Google isn’t /THAT/ bad, seriously. Although I will admit I usually find Amazon has much better deals on books that _I_ want, I have never seen this issue with Kindle books before.
Real Time Rendering is available in a Kindle edition but, I can only view it using the PC/Mac clients or the iPad client. You cannot tell me that dinky ass XGA screen on the iPad can display books better than my 22″/1080hd monitor using the Cloud Reader client, or my Android tablet with hit’s 10.1″/720hd screen. OK, I can understand it might not look sexy on my phones 3.8″/WVGA screen but still, wtf? Total steaming pile of stupidity right there. 
I want my content and I want it on all of my able bodied devices!
That discovery inspires me to jump ship and change my purchasing habits: to Google Play by way of Play Books. Once upon a time I thought about just going with whichever resource gave the best price, Amazon, B&N, or Google; Kobo I won’t trust with my $data after poking ’round there site. In practice though I found that having consisency like all my books either via Amazon, or physical books, was much more convienant than maybe saving $2 here or $5 there. Even for price differences between used real books and electronic books, because my shelf space is at a premium in the real world.
Looking at other books of interest, here’s a little break down:

`

Title Amazon Kindle Price Google Play Price List Price @Amazon Amazon Availability Google Availability
Real-Time Rendering $58.28 $69.42 $89.00 PC, Mac, iPad Web, iOS, Android, eReader
OpenGL SuperBible: Comprehensive Tutorial and Reference $28.59 $37.67 $59.99 Kindle, iOS, Android, Blackberry, PC, Mac Web, iOS, Android, eReader
Essential Mathematics for Games and Interactive Applications, Second Edition: A Programmer’s Guide N/A $47.36 $59.95 N/A Web, iOS, Android, eReader
3D Game Engine Design: A Practical Approach To Real-Time Computer Graphics N/A $66.36 $82.95 N/A Web, iOS, Android, eReader
Linux Kernel Development $17.69 $31.19 $39.99 PC* Web, iOS, Android, eReader
Understanding The Linux Kernel $29.79 $37.67 $59.99 PC* Web, iOS, Android, eReader

eReader in the above table is defined as what is described here. Amazon Availability is what’s listed on the web page, although I assume the OpenGL SuperBible would work with WP7 and the Cloud Reader clients too. Ones marked with a * say what is listed but e.g. can have a sample sent to my tablet, so I’d assume they work anywhere.
Loss of dedicated applications for Windows Phone and Blackberry don’t bother me, I don’t use either, and should have other means of accessing my content off these devices if I ever need to change. I’m also inclined to think that Google’s published policy on removals beats the shit out of Amazon’s track record. From the look of the help pages, Google also offers more natural syncing between devices, as long as you don’t have to resort to pushing files over Adobe/USB. So really the only gripe I can have is the when the price tag may be more drastic (like for LKD).

The Big Android Browser Test

There have been a couple of things on the net about various browsers, I’m sure, but certainly nothing comprehensive that I have found. Like wise, over @XDA in the Transformer forums at least, things tend to get muddled up after awhile from all the commentary.

So I thought I would install a shit load of browsers and do some testing! My test procedures can be found here.

It will take a while to do in my off hours and I doubt I’m going to get much done today, stuck home with the parental unit sick, so, I’m pretty much on butler call all day :-/. I’d rather be getting work done, like debugging yesterdays crap near interrupt free.

My summery of Android versions

  • 1.0.
    • September of 2008.
  • 1.1.
    • February of 2009.
    • General software refinements, which I’ll usually omit below.
  • 1.5 Cupcake.
    • April of 2009.
    • Third party (custom) keyboards are now possible.
    • We got widgets!
    • Bluetooth A2DP and AVRCP profiles (think stereo).
  • 1.6 Donut.
    • September 2009.
    • Voice I/O.
      • Voice input (Speach to Text).
      • Multi-lingual voice output (Text to Speech)
    • Apps can make their data available to search results.
    • Better support for gestures.
  • 2.0 – 2.1 Eclair.
    • 2.0 in October of 2009, 2.0.1 in December of 2009, and 2.1 in January of 2010.
    • Support for multiple accounts in sync.
    • Exchange account support for email.
    • Camera app sucks much less.
  • 2.2 – 2.2.3 Froyo.
    • 2.2 in May of 2010, 2.2.1 and 2.2. in January of 2011, 2.2.3 in November of 2011.
    • Dalvik VM gains Just In Time (JIT) compilation.
    • Exchange support becomes USEFUL.
    • USB and WiFi tethering. (Use your phone as a bridge between your laptop and your data plan.)
    • Now have the option to DISABLE mobile data.
    • Apps can now be installed to external memory (e.g. MicroSD card).
  • 2.3 – 2.3.7 Gingerbread.
    • 2.3 in December of 2010, 2.3.3 in February of 2011, 2.3.4 in ???, 2.5 in July of 2011, 2.3.6 in September of 2011, and 2.3.7 in ???.
    • Native support for SIP VoIP.
    • Selecting text to cut/copy/paste actually works.
    • Text input cursor can now be precisely positioned.
    • Ext4 replaces YAFFS(2) as standard file system.
    • Native support for more sensors; gyroscopes, barometers, etc.
    • NFC support.
  • 3.0 – 3.2.2 Honeycomb
    • 3.0 in February of 2011, 3.1 in May of 2011, 3.2 in July of 2011, 3.2.1 in September of 2011, 3.2.2 in August of 2011.
    • Notification bar moved from top of screen to bottom corner.
    • On screen software buttons (back, home, multi-task, menu, …) and the action bar.
    • View of recent apps can be snap shots (multi-task button) or existing icon view (long press physical home button).
    • Browser UI becomes more like Google Chrome.
    • Browser can now sync bookmarks with Google Chrome.
    • Apps are now commonly multi-pane, e.g. message list and message body on one screen.
    • More hardware acceleration.
    • Support for multi-core CPUs.
    • Encrypting user data.
    • USB devices now work as expected, e.g. flash drives, game pads.
    • Proper support for Bluetooth keyboards, gamepads, etc.
    • Stock launcher now allows widgets to be resized.
    • WiFi performance can be maintained when screen is off (WiFi locking).
    • Apps designed for small screens can be zoomed or stretched to fit.
      • this Android 2.2 feature is a really good thing and makes many reviewer’s complaints about Honeycomb less of a big deal for normal people.
    • Screenshots (or was this just a TF101 thang?).
      • Previously required a custom ROM like Cyanogen Mod.
    • Pasting integrated with 2.3.x selection UI.
  • 4.0.1 – Ice Cream Sandwich.
    • 4.0.1 in October of 2011, 4.0.2 in November of 2011, 4.0.3 in December of 2011.
    • Small screens get traditional (1.0-2.3.x) UI, large screens get tablet style (3.x) UI from Honeycomb.
    • On screen software buttons (from 3.x) now work on phones.
    • Stock launcher catches up to common features of custom launchers.
    • Access apps from lock screen.
      • Previously required custom ROM/UI (e.g. Sense; Cyanogen Mod).
    • Unlock your phone by taking a picture of your face.
    • New Roboto font.
    • Can now monitor data usage without requiring third party apps (or custom ROMs).
    • Camera app sucks less.
    • Basic photo-editing.
    • Much stronger NFC integration, alternative to Bluetooth data transfer.
    • Yet more work on hardware acceleration.
    • WiFi Direct, a form of Ad-hoc WiFi networking and bridging.

Dropbox 2.0 for Android: fixing your folder

I don’t get why so many people are pissed at this. The old folder location was at ${sdcard}/dropbox. This is really good for an app like Dropbox and I wish they would have kept it, but to be honest, it does technically belong in the new location of ${sdcard}/Android/data/com.dropbox.android/files/scratch. Although I would’ve used dropbox or cache instead of scratch but whatever.

Don’t like it? Well guess what, fix it yourself. Open a terminal emulator [0] [1] and do the following:



example# ln -s /mnt/sdcard/Android/data/com.dropbox.android/files/scratch /mnt/sdcard/dropbox

If you get an error about no ln command being found, you should install busybox and add it to your $PATH.

If you’ve got a real MicroSD card, you may get an error about the operation being unsupported (etc). In which case you either need root or you need to use a file system that supports symlinks. Which means probably reformatting your memory card as NTFS, or EXT4, or YAFFS2. Whatever your shit can read, because FAT32 is probably not going to support symlinks.


If you’ve got a device like my Transformer, that has an internal memory on /mnt/sdcard (${sdcard}), odds are the actual data is somewhere behind a FUSE shim, and is really stored at something like /data/media on an ext4fs partition. Easy symlinkage!

If none of the above makes any sense, you only no one tenth the power of Android and should have learned more about unix and Android, or maybe have bought an iPhone.

My word, if you’re not using Opera and it’s Dragonfly for web development, all I can say is Firebug users, eat your bits out.

Hello old friend

Well, I’ve just done something unexpected: I installed Opera on my workstation.  It has the operating systems default (a red dinosaur) and Google Chrome setup, which I have used since I got tired of diving into Firefox only for Firebug. In practice, I find Chrome’s stuff to be equally useful to me.

Now, why did I install opera? Generally I like to keep my environment pretty much the same; a look at my shell profile would make that obvious. At home, Chrome has developed an odd problem on my desktop, Dahlia. No sound plays: be it from Flash or Silverlight. Haven’t tried anything else, since e.g. WMV and QuickTime seem to have died out in the last lustrum (good riddens QuickTime!).

So, I am considering replacing Chrome with Opera as my defacto standard browser, as much as I love Chrome, do I really like openning another browser whenever I want sound? If you say try Firefox (or relation there of) I will find where you are and unplug your Internet with a vengeance. The only other browser Dahlia has is Internet Explorer 9; which is actually a nice enough browser to use but doesn’t even meet my criteria as well as Mozilla.

Pluses for Opera:

  • We’re old friends: I used to use Opera 8.5 – early 9.x as my daily surfer.
  • It’s stable, tried, true, and reliable.
  • I use Opera Mobile on my Androids.
  • It’s not the fattest ass at the track, *cough*.
  • Tomorrows staple feature is usually probably be todays Opera feature.

Negatives:

  • Some moron developers treat Opera like a deranged step brother.
  • Silverlight isn’t officially supported, but probably works.

I find it startling how much alike Opera Mobile and Opera is. All that is really missing is more advanced settings, and ‘lesser’ used features like gesture support (cool) and panels.

We’ll see what happens but I’ll give the experiment a go. Something that especially interests me, it seems that Opera Dragonfly is more or less the same thing as what Chrome has, plus “Opera Turbo” may be a viable option. At work, things can get really congested on the network, especially the wired one my desk switch, workstation, and test units mate with. So WiFi is usually the only way to browse to Internet resources – Opera Turbo might help with the network spikes, so I’ve got it set to automatic here, at home I won’t need it.

Opera Turbo is a function that feeds data through a proxy server for compression, all that means to normal people is that if your computer is older than petrified dog shit or you’re on a slow network, you get faster page loads. The privacy issue doesn’t bother me much, not at work. No one is watching closely AFAIK but there’s little to find past e.g. editing my calendar.

Thoughts on Android development *ON* Android

I’m crazy enough for it, after all BTEP+{bash,vim,coreutils,etc} on the TF101 is about as pleasant as on a netbook. The difference between BTEP and XTerm, makes something like Screen or TMUX a necessity IMHO and I favour the latter. Also copying and pasting from vim to Android apps is different. Without vim’s X support, a temp file is the best solution until BTEP gains real support for text selections.

My point being, if you can use a netbook and a command line environment, doing it on Android is no different. Hell you could even SSH into a phone from a PC if you lack a Transformer or a tablet+Bluetooth keyboard setup. Only people that _require_ something like Eclipse or Visual Studio are seriously impacted, and emacs and vim are good tools when combined with GNU tools (BusyBox a bit less so).  I have the equal of Debian without X.Org running on my transformer, a decent terminal emulator, and a real keyboard. So I am well equipped.

Now, the sticky part is actually being able to compile and run Android Java programs. You can write the code on a napkin if you want but that doesn’t work with your devices CPU quite so easily.

Android developers should already know the compilation model:



        *.java -> *.class -> *.dex -> classes.dex

A compiler is used to convert the source code into Java bytecode. This technically means that any language that you can get running on a JVM, and interface with Java code, you can probably use for Android development; in practice I’m sure there are more devils in the finer details.

After we get the Java bytecode, we have to convert it into a format for the Davlik VM to run. That’s where the dx program comes in. It translates Java to Davlik.

Because applications are rarely composed of pure source code, especially Android ones, things get slightly more complicated to create a .apk file you can install. The packaging tool aapt, apkbuilder, and aidl programs join javac and dx in creating the .apk file, the end goal of our the toolchain. In practice: .apk is pretty much .jar, which is pretty much .zip. Only classes.dex is used instead of a .class file per class in your code, and something I wonder why Sun never thought of!

Now, the issue is obviously how to run all this shit on an Android device, like my Transformer.

Google only publishes SDKs for Windows, Linux, and OS X systems on x86, Linux+ARM isn’t supported, sadly. Installing an x86 emulator and a mini distro with Java  and ssh is over kill, even for my Debian chroot loving self! BUT most of the SDK is in Java or BASH!

Java runs on Debian/ARM, so we can install a JDK and JRE, and thus get access to the Java side. Bash is already available for Android, let along Debian/ARM. So! The point of concern becomes x86 binaries. That seems to amount to most programs in platform-tools/ and tools, but what do we /actually/ need? Well guess what Jack, if we’re doing development on device, we don’t need the emulator! AFAIK the tools we do need are:  apkbuilder, dx, javac, probably jarsigner. The aapt and android programs being good to have, ditto for ant I’m sure.

aapt is a binary, so at best it would have to be natively or cross compiled, and much like make in C country, we can probably do it another way. The source is probably in the Android Open Source Project (AOSP) somewhere, which would make this easier.

android, apkbuilder, and dx are bash scripts.

android sets up an invocation of the Java VM (java) with tools/lib/sdkmanager.jar and a suitable SWT JAR and runs the program. I don’t know if SWT needs to be in the classpath when running it in command line mode, but hell, Debian/ARM = SWT deb somewhere.

dx is similar but uses platform-tools/lib/dx.jar.

ditto for apkbuilder, but using tools/lib/sdklib.jar

In looking at the manifests, a suitable Java execution environment is all that is needed for the serious leg work. That surely can be done using the JRE and/or JDK debs. Hoorah! And obviously the point of the “platforms/android-*” stuff is for javac and the emulator to work, android.jar in particular is our interest.

One downside, dealing with Renderscript or NDK stuff is another delema as obviously those rely on binary stuffs that are not Java, and AFAIK the toolchain for Renderscript depends on an LLVM frontend, so idk how to deal with that yet, but I’m not worried about it — most applications shouldn’t be using renderscript, unless maybe you’re making Modern Warfare 4 on Android >_<.

So I think, I is in business.

PostScript: I am aware of the Terminal IDE app but prefer to be closer to the official SDK and I would rather stick closer to my Debian chroot, especially because BTEP+tmux is a better place for using VIM with a real keyboard.