Category Archives: Android

Port forwarding over SSH to an Android Thing(s)

I was a bit frustrated on this one, because even if the commands are fairly easy, the results are hard to debug when they show up.

I wanted to be able to connect to my Android Things RPi3 device over SSH. This is pretty much simple port forwarding shenanigans but I got stuck for it for about an hour.

My computer setup looks somewhat like this

|            |
| Computer 1 |
| (client)   |
      | Interwebs
|             |
| Computer 2  |
| (server)    |
| port: 2222  |
      B Wifi
|            |
| RPi 3      |
| (Android)  |
| port: 5555 |

The command to make this work is

ssh -L 2223:[ip of RPi3]:5555 [user name to server]@[host name/ip of server] -p 2222

What this does is create a local port, 2223, on Computer 1 that connects to the ip of the RPi3 on port 5555, through the server using port 2222.

After this command is executed you will have to use your password to log in on your server, and it will end up at a console prompt. Open a new terminal window on Computer 1 and execute the following

adb connect localhost:2223

This will tell adb on Computer 1 to attempt a connection to itself, localhost, on port 2223, which is the one we created in the step above. This will automatically trigger that connection attempt to pass through the SSH tunnel and talk to the RPi3.

You should see your device being connected on Computer 1 through

adb devices

…and you should be good to go with monitoring, developing, or whatever you fancy, through adb.

Thanks to Otyg over at #sis on IRC

SmartWatch2+3 in one apk

So, I got into this thing when I developed a watch face for the SmartWatch 2 and wanted to see if I could combine it in any way to work with a SmartWatch 3 as well.

My route was a bit more strangled than the one I am about to present, but if nothing else, now that I’ve done that, you don’t have to!

Primary setup

The ingredients list, as of this writing, is straight forward. This is what you need before moving on:

  • Android Studio 1.0.2
  • Android SDK Tools 23.0.5
  • Android SDK Platform-tools 21
  • Sony Add-on SDK 3.0
  • Android SDK 5.0 (API21)

Step 1: Create a Wear (API21: Android 5.0) project

This is for the SmartWatch 3 part of this SmartWatch 2 and 3 mashup.

It is actually as simple as that sounds. In Android Studio, choose the File-menu -> New Project and decide what you’d like to name it along with all the other settings you’d like to use for your SmartWatch 3 project. NOTE! The package name is going to be extra important, as you will have to use that later on in this guide.

When you have ran through the wizard and managed to find yourself with a Wear project that compiles, let’s import a SmartExtensions project.

Step 2: Import one of the SmartExtension samples as a module

Using a sample project is a quick and easy way of getting the right dependencies in place for the SmartWatch 2 part of this mashup.

Importing a sample project is done by clicking the File-menu -> Import-module, browsing to the SmartExtensions sample folder directory (usually located in ANDROID_SDK/add-ons/addon-sony_add-on_sdk_3_0-sony-19/samples/SmartExtensions) and selecting one of the samples. The import wizard will automatically present you with the option of also importing the “SmartExtensionUtils” and “SmartExtensionAPI” projects. Make sure that you include these, or you will run into build issues because of missing dependencies.

NOTE! I chose the “HelloLayouts” sample during my tests. Any other sample should work but avoid importing the “SmartExtensionAPI” and “SmartExtensionUtils” projects, unless you want to create a project from scratch without any boiler plate setup from the samples.

Step 3: Do a bit of modifications to project files

Here’s the tricky part. It’s not that tricky though. You will need to:

  • Modify the SmartExtension sample package name
  • Creating release build signing configs

and do some edits to the following files:

  • The SmartExtension sample gradle file
  • The SmartExtension sample AndroidManifest

Modifying the package name

This took a bit of trial and error but in the end, the recipe I would use:

  1. Create a new package in the SmartExtension sample module that has the same name as the Wear module package name
  2. Drag-and-drop all the classes from the old package “com.example….hellolayouts” to the new package
  3. Delete the old package
  4. Open the AndroidManifest file in the SmartExtension sample and replace the old package name “com.example….hellolayouts” the new name
  5. Open the SmartExtension gradle file and replace the package name here as well, referenced as applicationId

Try to build (a clean may also be required) your SmartExtension sample module to see whether everything seem to be in the right places and don’t contain errors. I got some minor issues with imports to “com.sample….R” that had not been cleaned out. Deleting those manually worked out perfectly fine for me.

Modifying the gradle files to update references and build configs

To lay the last stones in the process, you will need to do some additional updates to gradle files, both the SmartExtension sample and the Wear app.

NOTE! These steps require you to have an Android keystore and the secrets that go with them:

  1. Open the Wear app gradle build file
  2. Add the signingConfigs declaration and reference as shown below:
android {
  signingConfigs {
    release {
      keyAlias 'YOUR_KEY_ALIAS'
      keyPassword 'YOUR_KEY_PASSWORD'
      storeFile file('PATH_TO_YOUR_KEYSTORE_FILE')
      storePassword 'YOUR_KEYSTORE_PASSWORD'
  buildTypes {
    release {
      signingConfig signingConfigs.release
  1. Open the SmartExtension sample gradle build file
  2. Add the same declarations and references as in step 2 above, but also include the following (replace ‘:app’ with the module name of your Wear module):
dependencies {
  wearApp project(':app')

Step 4: Configure the Build Variants

This is the last step before making the final build. Find the “Build Variants” panel in Android Studio (it’s usually located at the bottom left of the UI) and select release for the Wear app and the SmartExtension sample. Leave “SmartExtensionUtils” and “SmartExtensionAPI” on debug.

Select the SmartExtension sample as your build configuration, compile, run and deploy! (If the “Edit configuration” dialogue shows up, choose to not launch an Activity, as the sample does not have a Default one declared)

Step 5. Done!

Congratulations! You should now, given nothing breaks down on you, have a SmartWatch 2 and 3 combined Android Studio project!

Musings about going from Eclipse to Android Studio 0.3.7

So, the first time around when Android Studio was announced I was pretty excited. Seeing that something tightly connected to Android in the shape of a Google pushed IDE, well that should bring a lot of nice things!
But alas, after a few hours of tinkering and trying to import projects exported from Eclipse by following the it’s-supposed-to-be-this-easy guides, I gave up. Too many issues with importing my projects and also, not having really used IntelliJ and even less Gradle, it was just too many issues at hand to keep track of that I chose to postpone.
So, here we are, version 0.3.7 later and I must say it seems a lot more straight forward (in most cases).

¤ One thing that I really have to stress is Android Studios way of not helping out how to import projects based on bare Android source code. The guides talk a whole lot about Maven and Gradle, but it took me actually testing out an import where I ignored all those keywords and reading the IntelliJ documentation on importing code, to be able to deduce that yes, it is possible to import bare Android code.
Really, this should have been much more clearly stated/supported because now, there is no clear way at all whether this kind of import is supported or not.

¤ Another thing. In Eclipse it was possible to mark projects as libraries and then chain the dependencies in a way that your project can reference a library that in turn references another library. With Android Studio it seems that your project has to refer to all the libraries it needs, in effect not being able to chain the dependencies.

¤ Oh, a third thing. It seems like the terminology “project” in Android Studio is an umbrella for keeping track of one or more “modules”. The Eclipse “projects” seem to map to “modules” in Android Studio and I guess Android Studios “projects” are most likely “workspaces” in Eclipse.

My impressions on two not-that-old mobile OSes (Ubuntu Touch et. Firefox OS)

I had the good fortune of getting a “Firefox OS Developer Preview” device called “peak” delivered to me the other day. It took nearly a month from purchase to delivery and the overall information sharing by Geeksphone (the creators of peak) was not what I would expect. But I digress. We’re here to talk about the devices, or rather the OS on the devices. There already is an insane amount of videos and specs and whatnot on the interweb but I’d like to do my own writeup of these things, if you don’t mind.

Mix it

Alongside peak I decided to take a swing at Ubuntu Touch. Considering I already have a plethora of Nexus devices I wanted to choose one of them that wasn’t being used as my daily driver, which made the choice fall on the Samsung Galaxy Nexus. There was no real other reasoning behind this other than that I needed my N7 and N4 to stay in the shape they’re currently at but down the line I’ll test Touch out on those as well to see what kind of difference that makes.

To the summit

So, starting off with peak. This device gave me mixed feelings from the first get go when I took it out of its packaging (which is a pretty nice and interesting piece made out of recycled cardboard (I imagine)): It is plasticy, it has a weird “neck” at the top where the camera housing is located (sort of an inverse “neck” that the Galaxy Nexus has) and it has a somewhat iPhone’y look (bottom-middle-placed-home-button-and-nothing-more).

Booting the thing was a blast from the past when I saw the boot logo appear in all it’s 256 colour splendour. Everything after that has at least some 64K colours (probably even 16M but I haven’t verified). Booting was fairly quick, I didn’t have time to think any of it.

Lock/App screens
Having used a build of Firefox OS on a Samsung Galaxy S, I at least knew how to work with the lock screen. Being so used to swiping left or right or basically any direction from other devices (all the Nexi), double tapping the unlock symbol feels a bit awkward.

The homescreen layout and feel is, too me, more reminiscent of iPhone, apart from the one big clock “widget” (which I’m guessing can’t be switched out by something else in this version) at the top on the first screen.
Swiping to the left brings up two new screens. The first screen being a small set of tools such as camera, fm radio, settings, etc. Another swipe to the left brings up another small set of tools such as calendar, clock, e-mail, etc.
Swiping to the right from the homescreen brings up another iPhone-similar screen, which consists of a search field at the top and a collection of grouped circular app icons divided in categories such as social, weather, sports, etc. Tapping the search field and typing in letters quickfilters a result of apps that you have installed. This, which was a bit disappointing, didn’t search on the Marketplace (which is an app where you can go look for more apps!). That would’ve been a nice to have.
Moving about the screens works fine, however one thing that ticks me off: When I tap an app icon, sometimes the device registers this as a swipe. The first thought that came to my mind was “Oh, ok. So I nudged my finger a bit sideways, I’ll try it aga… hmmm, it happened again. And I swear I didn’t nudge my finger in any direction this time.”. This becomes a bit annoying after a while. I’ll take a look at the code at some point to see if I can Fix-It[tm].

Home lock screen

Home lock screen (found no way of hiding the toast...)

Home screen

Home screen

App screen 1

App screen 1

Finder screen

Finder screen

Looking at the apps, I took a dive into the Settings. It looks rather nice with clear icons (I haven’t figured out what the “Internet sharing” icon should look like, though… Some kind of chain links..?) and toggles (which are non-swipable). Tapping a setting, opens up the setting page for that setting…. and with that an almost impossible-to-hit-back-button in the upper left corner! I don’t know why this decision was made, but that’s what you get. I’ll see if I can Fix-That-As-Well[tm] later. I changed a few settings such as volumes and enabled lockscreen unlock sounds. One thing I noticed. THE UNLOCK SOUND IS REALLY LOUD! AND THE PHONE DIALLER SOUND AS WELL! And there’s no way to adjust the volumes for those. One thing that I found to be pleasing in all this cacophony of noise is that the external speaker really packs quite a punch.
Taking a look at the Browser, to me one of the integral parts of Firefox OS, it feels ok. Address bar at the top, alongside a sidebar-opener-button on the right hand side. At the bottom there appears a number of context sensitive navigation buttons. The browsing experience is ok, pages load fairly quick (running traffic over 3G) but, and this I don’t know why: More or less half of the times I would get greeted with a “Problem loading page” message. When this occured, each time I tried accessing a page, I could see the data traffic notifier icon animate a couple of times and then disappear as if nothing worked. I had to reboot the device whenever this happened. The Marketplace app was giving me a tough time. Half of the times nothing happened when I tapped the app buttons on the front page (featured apps I guess) after it had loaded, the other half of the times when I could tap (for instance) a category, nothing happened when I tapped an app button within the category, and lastly the third half of the times the data connection actually broke when navigating in the Marketplace so I had to reboot. All in all, a pretty horrible experience and I didn’t get to install any apps! Testing the HERE Maps app was interesting. It worked quite well, tiles loaded as they should, it found my GPS based location, I couldn’t figure out how to turn GPS off (or at least I couldn’t make the notification icon disappear. It changed color from white to gray, but never disappeared no matter what I did to settings or running apps). Also, the HERE Maps UI is really created for another screen density. Even tinier buttons than the back button in the settings mentioned earlier.

Settings page

Settings page with an infinitely small back button!

Broken Marketplace

Most of the times the Marketplace looked like this...

HERE maps

tiiiny buttons (HERE maps)

Ok, the experience so far has been rough. I do however understand that there is a reason it says “Developer Preview” all over this thing (well, it’s only stated at the back actually. But it’s clearly visible. No beating around the bush.). Over time when the software gets more mature, the device will follow along with it (here’s hoping that intermittent data connection drops requiring reboots will be a thing of the past (I’ll-See-If-I-Can-Get-Around-To-Fix-That-As-Well[tm])).
What I do sincerely like is the fact that this is supposed to be a truly Internet-centered OS and I absolutely believe that. What will be interesting is to see whether the populace of smartphone users and all the devs are ready, willing and mature to embrace it in order to make it _really_ usable. I’ll certainly try and be all of those and keep monitoring the situation while I spend my time adapting my web services to it.

[Adjective] [Animal]

Well, not really. Ubuntu Touch doesn’t really have that familiar naming that is connected to Ubuntu releases. I’m sure it will in the future though.

Getting a hold of a build and flashing this was a whole lot easier than I thought. One light pound of Galaxy Nexus, one ounce of Lubuntu, three pinches of apt-get and a hint of command lining and the thing was baked and ready to eat! No manual flashing of binaries in the correct order and right versions, it just worked[tm].

Booting up Ubuntu caught my interest in the fact that the only thing telling you that you are actually booting anything is the usual short vibration when pressing the power button and the Google logo… then everything goes black… and then you’re in Ubuntu Touch! For those of you who are used to later versions of Ubuntu, you will recognize the orange-purple colour scheme. Which I totally dig.

Lock/App screens
It’s really nice to rest your eyes on and the homelockscreen (in lack of a better word) is nice to look at. It displays a status bar with a bunch of icons, a digital clock at the top, a circular clock like widget with the text “14 tweets received” printed in it and a small marker working as a visual queue for the 14 tweets that “I” have received. Ok, that’s all nice but the question is though, how do I “unlock” this so I can start poking around? Tapping the “14 tweets received widget”? Pulling down the status bar? Swiping the “14 tweets received” widget?…. Apparently not. Ok, so let’s swipe and tap pretty much everywh… AHA! Swiping left from the rightmost edge was the trick! Nothing like a small moment of frustration on the first trial of a new OS.

So, now I’m at the Home screen (which is aptly named just that). It consists of a few Frequent apps such as Camera (that works), Phone (which doesn’t work), Browser, etc. Further down there is an area called Favourite People with a few happy people displayed on “cards”. Scrolling down we find People Recently in Touch, which I guess is who “I” contacted lately. Even further down we find Recent Music. Going down, here is Videos Popular Online. Scrolling a bit fu… No, wait. It stops there.
Naturally, as a smartphone user, I start swiping to the right and left and find a few more screens. The first swipe to the left reveals Apps (and also a bottom bar which pans in from the bottom of the screen, displaying which screen I’m at, represented by an icon), which displays a collection of Running apps. Below that is the previously mentioned Frequently used collection of apps and below that we find Installed and at last a collection called Available for Download. Swiping left yet again here is a Videos screen. At the top: Featured, below that: Recent, further down: New Releases, scrolling more: Popular Online. This is the end of the screens in this direction. Swiping right from Home reveals a People screen. This is in all essentiality “my” address book on a scrollable screen. Yet another swipe to the right displays Music. The content is laid out in much the same way as Videos so I won’t go through it once more. (After all, you have read 1774 words so far, and that’s not a small amount).



Running apps

Running apps

Navigator indicator

Navigator indicator

Status bar
Swiping the status bar was really awkward. I of course, being that naive, expected an Android kind of information curtain display. And it actually is pretty Android’y, but with the big difference that it’s aware of what status icon you swiped over and displays contents based on that. So swiping the finger down over the blue letter, I get the messages that I’ve been missing out. Swiping over the speaker icon displays audio settings. Nice touch (pun intended?)!

Messages pulldown

Messages pulldown

*Swipe* *swipe* *swipe*
So a bit of swiping later I’ve realised two things: 1: It’s really hard to do repeatable swipes and access what you would expect. 2: See 1. The reason for this is that more or less everything is swipeable and yields different results. More often than not I would actually start to swipe a bit too far to the right or left of the screen which would not switch between the home screens (or any other paged view) but instead either 1: bring up the quicklaunch sidebar for a brief half a second and then bring me back to one of the home screens or 2: switch between already running apps. These are neat features but they’re in the current state of things more a nuisance than of assistance.
Oh, another thing. I found a sort of Google Now equivalent. When in an app, you can swipe upwards which reveals a semi-transparent icon with a looking glass. Releasing the finger over it brings up a field (and a few buttons) that says “Type or say a command”. I tried to type “message” but it didn’t do anything.

Quicklaunch sidebar

Quicklaunch sidebar

Find it

"Ubuntu Now" spyglass icon

While poking around the different apps I found another hidden gem, so to speak. Opening the Phone app gives you pretty much what you would expect: somewhere to tap in a number and then a button to place the call. However, looking at the top of the app there is something that tells the tale of more under the surface. The title of the app is “Call >” and I just tested out tapping the text and what do you know, there are more options revealed! So in the Phone app you will now have the different scrollable “tabs” Call, Conversations and Contacts. When you have selected a tab, the other options will fade into the background and reappear if you swipe or tap the title again. Neat! There are a couple of more apps bundled in this software, however, either they require signing in or they aren’t functional and just work as placeholders.

Displaying scrollable tabs

Displaying scrollable tabs

Remember when I mentioned the first trial of a new OS. When I say that this is an OS, you may believe that this is something that can be used, perhaps not as a daily driver but at least to some extent for mail and some basic messaging, maybe some music entertainment. But you know what, I wouldn’t recommend it. This is, in my opinion, something that you are going to use as a way of trying to understand what the Ubuntu creators are up to in the mobile scene. One of the very telling tales of this is that there is a pre-installed, pre-populated account. There are a whole bunch of fake friends, fake messages, fake videos, fake music, and so on. I have found no way of switching users. I was able to create a user (with a bit of adb and ssh keyboarding) but nowhere did I find a Log out or Switch account-button.
Also, the screen won’t turn off automatically. Ok, so this isn’t really a usability thing but it’s still one of those things that are pretty vital if you don’t want a dead weight in your pocket because you accidently hit the power button.

The end

Ok, so where does this leave us? Well, these OSes don’t really have a lot in common other than being run on mobile devices and having Android as their common denominator. Firefox OS is focusing in on a lightweight system which primarily make use of different kinds of web technologies to make itself usable. And seeing the explosive nature of Internet services and availability, I’m pretty confident that this will find its place. Especially considering that adaptation of an already existing web service should prove not to be too high of an effort.
Ubuntu Touch is instead going in the direction of becoming your ubiquitous-carry-around-mini-format-computer OS. This in itself opens up another set of possibilities (I would love to see the day when I can have a docking station at home and at work that are hooked up to a screen, keyboard and mouse and the UI  seamlessly switches between desktop and mobile depending on whether the device is in the dock or not) but also challenges in the shape of app making.

Ok, so this was my take on Firefox OS and Ubuntu Touch at this point in time. For those of you interested in more developie or tekkie reading material, you’ll have to wait a while longer until I’ve started to get around to keyboarding out a few samples. These thing take time, mind you. Why not do a little bit of searching on the Interwebs while you wait?

Windows 7 64-bit + Java jre 7 != Körbar Android SDK Manager

Satt och klurade lite på varför Android SDK Managern vägrade starta. Lite ostrukturerat googlande gav tills lut denna StackOverflow-frågan:

Kortfattat: Det kan finnas flera java.exe-binärer som innebär att fel binär kopplas till Android SDK Managern. Om man ser till att ens PATH innehåller sökvägen till mappen där jre 7-java-binären ligger, samt att sökvägen finns _innan_ sökvägen till \windows\system32, så borde det lösa sig. Ta gärna och kolla vad kommandot “where java” spottar ur sig.

setTag, getTag sitting in a tree…

Jag knåpar ihop en app som ska hålla koll på antalet slag man gör under en Frisbeegolf-runda och ganska oundvikligt hamnade jag i arbetet med att lägga till och ta bort View:s dynamiskt. Dessutom behövde jag på något sätt sitta och klura ut hur layouten av dessa View:s skulle se ut, vilket obönhörligen gjorde att jag snabbt kom i kontakt med getTag och setTag tillsammans med LayoutParameters.

En liten kodsnippet på hur det kan se ut

TextView textScore = new TextView(this);
textScore.setText("" +currScore.getScore());
RelativeLayout.LayoutParams paramsScore = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
paramsScore.addRule(RelativeLayout.BELOW, textPlayer.getId());
row.addView(textScore, paramsScore);

Enkelt förklarat kommer denna kod att lägga till en View relativt positionerat under View:n textPlayer. Guld och gröna skogar, men vad man måste se till att hålla reda på är att setTag inte gillar att man använder id:t 0, som i setTag(0), för då kommer den View man vill positionera relativt att inte hamna just relativt till något annat än, så vitt jag kan förstå, till föräldern.

Alltså, se till att använda setTag med 1-indexering: setTag(1), setTag(2), …!

Galaxy Nexus, yakju -> yakjuxw

Jag har följt en tråd på Swedroid vilken handlar om att flasha om sin USA-flashade Galaxy Nexus-image till en mer svensknordiskeuropeisk-vänlig sådan. Detta är en guide för hur man kan återställa sin Galaxy till det originalformat man köpt den i.



  • PdaNet for Android (
  • Paul’s superboot, GSM-modellen (
  • yakjuxw-image ( Observera att detta inte är en image som publiceras av Samsung eller Google. De har med största sannolikhet kommit från användare som lyckats ta kopior av sitt yakjuxw-system som de sedan varit vänliga nog att dela med sig av. Jag har lagt upp den på mitt Mediafire-konto, om inte annat för att själv ha tillgång till den om jag skulle behöva. Kontrollera följande hashar mot de filer ni laddat ner så att ni åtminstonde har någon verifikation på dem:
[MD5 hashes]
radio:      15d6bd69920a64e4acf3279271e73648
bootloader: 3f981a8e5f91df8a7a26a7583c1f80f8
boot:       c57720964027d8afdcee4c071dde2011
system:     46e6b6cd98ccf0006d21ccce62082165
recovery:   6046d9fcf2e877ad40d6a8e77c145c65
userdata:   d003ab084270edd22483ce8f1f8b05c9


Installera PdaNet i Windows enligt alla konstens regler. Jag föreslår att man kopplar ur Galaxyn från USB:n (alternativt att man inte kopplar in den i datorn alls) innan installation av PdaNet. PdaNet innehåller drivrutiner för att kunna kommunicera med ett gäng olika telefoner över ADB och fastboot och det var det enda paket som jag fick att fungera ordentligt.

Packa upp innehållet från Paul’s superboot och yakjuxw-image i en lämplig mapp som du enkelt kan komma åt med kommandotolken/terminalen i Windows.

Utför dessa kommandon (OBS! Detta kommer att nollställa enheten totalt, så se nu till att ta BACKUP innan du kör detta)

c:\> fastboot-windows.exe flash bootloader bootloader-maguro-primela03.img
c:\> fastboot-windows.exe reboot-bootloader

//Vänta i ca 5-10 sekunder

c:\> fastboot-windows.exe flash radio radio-maguro-i9250xxla02.img
c:\> fastboot-windows.exe reboot-bootloader

//Vänta i ca 5-10 sekunder

c:\> fastboot-windows.exe flash system system.img
c:\> fastboot-windows.exe flash boot boot.img
c:\> fastboot-windows.exe flash recovery recovery.img
c:\> fastboot-windows.exe flash userdata userdata.img
c:\> fastboot-windows.exe reboot


Då var det klart! Om allting gick vägen och det inte blev några problem med något av de angivna kommandona ovan har du nu en yakjuxw-baserad image till din Galaxy Nexus. Grattis!

Galaxy Nexus, yakjuxw -> yakju

Jag har följt en tråd på Swedroid vilken handlar om att flasha om sin svensknordiskeuropeiska Galaxy Nexus-image till en mer USA-vänlig sådan. Mycket handlar om att vilja få tag på Android-uppdateringar lite snabbare än om man skulle sitta på original-image:n, som enligt massvis med rykten, av okänd anledning, ska behöva gå genom Samsungs väna(?) behandling innan den släpps.

Det finns en guide i den tråden som jag är lite extra förtjust i, då den till 99% flashar om Galaxy Nexus med hjälp av en helt vanlig terminal och inte genom nån hopsnickrad peka-klicka-programvara där man har noll koll på vad som försiggår. Dessutom ser jag inte någon anledning att köra ett peka-klicka-gränssnitt om man kan göra saker och ting på samma enkla vis med en terminal.

Guiden är, lite ironiskt, baserad på att använda Windows. När jag följde lite olika guider var det massvis med Windows-fokuserade program som skulle köras och när jag till slut hittade en terminal-baserad guide som fungerade så växlade jag inte till Linux för att köra den där. Jag kan undersöka om det finns tid och ork att ta fram en Linux-baserad guide med.

Tro nu inte att denna guide är ett monster att gå igenom på grund av dess längd. Faktum är att det är en rätt kort procedur, men jag ville erbjuda en väldigt bildbeskrivande guide för de som känner sig väldigt osäkra på proceduren. Jag använder Windows på engelska, men med lite snabb huvudöversättning så kommer man att gå igenom den här guiden i ett nafs.




Installera Android-drivrutinerna enligt följande lilla guide

1: Börja med att ladda hem drivrutinspaketet “Drivrutiner för Android” ovan, lägg den på skrivbordet. Jag använder WinRAR för att hantera dessa filer, så proceduren kan skilja en aning i det avseendet men generellt är det samma steg.

2: Packa upp innehållet i en valfri mapp, tex C:\galaxynexus, jag valde att lägga den på skrivbordet för guidens skull, men bara du håller reda på var innehållet tar vägen är det inga problem.

Som exempel på hur det bör se ut när du är färdig så visar jag här en skärmdump på listan över filer och mappar genom kommandotolken, som du kommer att använda dig av senare.

3: I Windows, klicka på Start-knappen/kulan -> högerklicka på Computer -> Manage. Klicka sedan på Device Manager i vänsterpspalten. Leta upp “Other devices” eller motsvarande där det finns en “Galaxy” med gul varningstriangel.

4: Högerklicka på “Galaxy” och välj “Update Driver Software…”

5: I dialogen som dyker upp, välj “Browse my computer for driver software”

6: Tryck på knappen “Browse” och se till att hitta den mapp som du packade upp i andra steget i denna bildguide. I den mappen ska du nu öppna “amd64” om du har Windows i 64-bitarsvariant eller “x86” om du har Windows i 32-bitars variant. Oavsett val här ska du därefter välja mappen “_drivers_google”, se till att “Include subfolders är iklickad” och klicka på Next. Se bilden nedan för ett livligt exempel.

7: Nu kommer Windows att försöka hitta en lämplig drivrutin och med absolut största sannolikhet presentera en röd dialog. Klicka på knappen “Install this driver software anyway”. Kortfattat är det så att Google’s drivrutiner inte är verifierade på något av Microsoft’s godkända vis, men det är mer en teknikalitet än att något allvarligt fel kan inträffa.

8: När Windows fått jobba en liten stund presenteras du med denna (inte så) lilla glada ruta

Grattis! Du har nu installerat drivrutinerna för ADB. Du kommer att behöva utföra denna procedur en gång till i guiden, så kasta inte mappen med drivrutinerna riktigt än.

Packa upp innehållet från Pauls superboot och IMM76I i en lämplig mapp som du enkelt kan komma åt med kommandotolken/terminalen i Windows.

Utför detta kommando

c:\galaxynexus> adb-windows.exe reboot bootloader

Nu kommer telefonen att boota om och hamna i så kallat fastboot-läge. Du kommer nu att behöva utföra drivrutinsinstallationen enligt bildguiden ovan, från punkt 3. Det kommer nog att gå lite snabbare för dig den här gången när du nu har ett humm om var saker och ting befinner sig. Skillnaden mellan förra installationen och denna är att det i Device Manager nu finns en annan enhet som heter “Android 1.0”

När den andra drivrutinsinstallationen är slutförd, skriv in detta kommando (OBS! Detta kommer att nollställa enheten totalt, så se nu till att ta BACKUP innan du kör detta)

c:\galaxynexus> fastboot-windows.exe oem unlock

När du svarat “Ja, jag vill nollställa allt och låsa upp bootloadern” på Galaxyn, kör nu följande kommandon

c:\galaxynexus> fastboot-windows.exe flash bootloader bootloader-maguro-primela03.img
c:\galaxynexus> fastboot-windows.exe reboot-bootloader

//Vänta i ca 5-10 sekunder

c:\galaxynexus> fastboot-windows.exe flash radio radio-maguro-i9250xxla02.img
c:\galaxynexus> fastboot-windows.exe reboot-bootloader

//Vänta i ca 5-10 sekunder

c:\galaxynexus> fastboot-windows.exe -w update


Då var det klart! Om allting gick vägen och det inte blev några problem med något av de angivna kommandona ovan har du nu en yakju-baserad image till din Galaxy Nexus. Grattis!

Men hallå, det funkar ju inte!

Q: Jag fastnar på drivrutinsinstallationen när jag kört kommandot “adb-windows.exe reboot bootloader” och en Android ligger på rygg med en lucka öppen på magen. Det dyker bara upp en “Unknown Device” istället för “Android 1.0” i Enhetshanteraren och drivrutinsinstallationerna fungerar inte!

A: Tack vare sirdjorgo kunde jag till slut komma fram till att detta beror på en eller två anledningar, antingen var för sig eller i kombination. 1: Man har installerat Samsungs drivrutiner sedan tidigare (antingen genom Kies eller genom andra Samsung-installationer) och för att guiden ska fungera måste man avinstallera allt detta först. Efter avinstallation rekommenderar jag att man startar om datorn. 2: Telefonen har slutat svara och kan inte kommunicera med datorn. Detta är inte alls tydligt, för det syns inte på telefonen att detta inträffat och inte heller på datorn. Det enda som bekräftade att telefonen slutat svara var när vi försökte trycka på “Start” (powerknappen) och telefonen inte bootade om eller ens reagerade. I det här läget är den enda utvägen att rycka batteriet, boota upp telefonen som vanligt och börja om från och med kommandot “adb-windows.exe fastboot reboot” så att telefonen hamnar i fastboot-läge igen.

Starta en aktivitet i en app från en annan app

Det här “tricket” kan vara användbart om man skapar en liten svit med appar som är tätt bundna till varandra, men inte nödvändigtvis måste leva under samma tak/app.

I appen vars aktivitet du vill starta utifrån, gör

Ändringar i Manifestet

Leta upp den aktivitet-tag, <activity>, som du vill kunna nå utifrån och lägg antingen till ett <intent>-filter, eller en rad

  android:exported="true" >

Som exempel kan ett helt Manifest se ut

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
 android:versionName="1" >
  <uses-sdk android:minSdkVersion="7" />
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      android:exported="true" >

I appen du vill kalla på en annan epps aktivitet, gör

Följande i kod

Intent intent = new Intent();
intent.setComponent(new ComponentName("nu.opentest", "nu.opentest.activities.OpenMeActivity"));

Med detta kan man nu alltså inifrån en app få upp en specifik aktivitet i en annan app. Jag rekommenderar starkt en massa try/catches för att inte åka på en nit under produktion.

Samsung Galaxy Tab (P7300), virtuellt tangentbord och emulatorn

Jag har ingen egen SGT men jag har däremot fått låna en. Mitt mål nu är att (på ett så våldsamt sätt som möjligt) bryta ut det virtuella tangentbordet och försöka installera det på emulatorn, så jag inte är strikt bunden till att ha tab:en varje gång jag vill felsöka tangentbordsproblem.

Det är en process i stegen

  • Skaffa en kopia av SGT:ns original-operativ
  • Skaffa simg2img för att kunna montera de system-images som finns i SGT:ns original-operativ
  • Ta ut filerna
    • T9DB folder (from csc.rfs file)
    • AxT9IME.apk and AxT9IME.odex (from system.rfs file in app folder)
    • touchwiz.xml (from system.rfs file in etc->permissions folder)
    • and
    • android.policy.odex
    • bouncycastle.odex
    • core.odex
    • core-junit.odex
    • ext.odex
    • framework.odex
    • services.odex
  • Ta hem baksmali och smali för att kunna deodexa tangentbordet
  • Ta den deodexade tangentbordsfilen, döp om till classes.dex, lägg in i AxT9IME.apk
  • Placera alla de filer (förutom odex-filerna) som togs från operativet och lägg dem i sina respektive korrekta mappar
  • Be till Cthulhu