Friday, March 30, 2012

Decompiling an Android App "at" Marakana

This time my topic is not directly presented here, you can find it here.
I will just tell you the backgroud story.

So, how comes, that I wrote an article for marakana?
Roughly two weeks ago I attended the Droidcon in Berlin and listened to a presentation by Marko. Marko is one of the founders of marakana (what I didn't know by that time). In the evening, in fact during the socialising part of the Droidcon, I talked to him because his presentation was very interesting for me and I wanted to know more. That ways we started talking and he told me, that I could write an article for marakana so a bigger audience could read it (because way more people know marakana than my blog).
Well, as you can see, I wrote the article and the counter there is at 139 right now. Even with some people opening it twice or three times it's quite an impressive number for me.

What do we learn from this?

From time to time you gotta leave your "nerd cave" and talk to random people ;)

Thursday, March 29, 2012

Overview Git commands

As I mentioned in my first Git-post I wanted to prepare a nice overview for the Git commands, so you can print it and put it next to your PC or keep it in your pocket ;)
Unfortunately the people at GitHub didn't answer my question if I may publish it. Because I didn't want to wait any longer and because I wanted to give it to you guys I made sure it fits the German citation laws.

So, here you go:

If you find any mistakes or have an idea for improvements please let me know.

Saturday, March 24, 2012

Problems with ADT17/Reverting to ADT16

Yesterday, I upgraded my Android SDK and ADT to version 17, especially because I wanted to see, how I could use the new, generated BuildConfig class.
So, after starting my emulator, a NoClassDefFoundError was thrown, when starting the second activity with an intent.
After some searching I found this solution
Well, I use Maven for my dependencies and that's why that solution doesn't work for me(I just assume, that FoxyKeep is right).

After messing up the whole classpath of my app, I decided to just switch back to version 16.
If you want to do that too, follow these steps:
  1. Download the old SDK (actually I am not totally sure, if it's necessary to revert the SDK, but I wanted to minimise possible errors). Just copy one of the download links and change the version number.
  2.  Replace your tools folder with the tools folder from the old version.
  3. Deinstall the ADT in Eclipse (reverting in Eclipse didn't work for me)
  4. Download the old ADT by taking the link from here and again, changing the number to the desired version.
  5. Install the ADT in Eclipse by following the steps listed under "Troubleshooting ADT Installation"
And now you're good to go. Maybe you have to fix the conversion-to-dalvik-format-failed-error again, but that's all.
If anyone finds a solution for ADT 17, please let me know ;)

Friday, March 23, 2012

Experiences with local Git and Eclipse

Some weeks ago I wanted to learn a little bit about Git because it is quite a buzzword. I already knew how to work with SVN and CVS, so I thought that it couldn't be very different.
I won't list any differences between those here. You can find out by yourself (and you are encouraged to do so ;) ).
What was really useful for me, was, that it is pretty easy to put a local folder under Git control. Just installing Git, adding it to the PATH-variable and that's all the preparation you need.
After that, just switch into a directory you like and type:
git init
Now your folder is under version control. (if you type into your shell ls -la you'll see the new .git folder)
If you put some files into that directory and add them with  
git add
and commit them with
git commit
Now you can keep track of your changes.
Of course, if your hard disk gets broken Git won't have any use for you. But one possibility would be to add a folder to Git (as described before) on an external hard disk or an usb-drive and then, on your hard disk, call
git clone "path to the external drive"
Now you are able to store your changes there and, depending on how you treat your hardware ;) , keep them quite safely.

Another nice advantage is, that you can put your existing Eclipse projects under version control and then use EGit. You only have to remove those projects from Eclipse, call git init on them and add the repository to Eclipse (under Git repository view). Now you can import them from the repository view.
It'll look like this:
EGit showing some repositories, including the local one

Last week I accidentally deleted a src-folder from one of my projects because I didn't read the Eclipse dialog, if I was sure about doing that. What a luck that folder was under my local version control. I was able to restore everything (of course except for my last changes).

It gotta thank the people of because that website is a really good overview for the different commands. I'll try to shorten those commands a little bit, so that they fit one piece of paper and put that file up, so everybody can print it, as kind of short reference. But before I do that, I will ask the gitref people because I used their website.

Wednesday, March 21, 2012

The symbol @ in LaTex or just thinking way too complicated

When I recently wrote a report in LaTex I struggled to get the letter @ into that report.
My thought was, that @ has to be some kind of special symbol in LaTex, because everything that's not a letter or number is a special symbol for starting e.g. some formatting (what is actually wrong, but you'll find out later).
So, my first try was to escape the @ with a backslash. And, after saving, my TeXlipse showed me an error (Missing $ inserted. \@).
Ok, no problem, I have to escape the backslash for escaping the @ with another backslash. Actually, that worked so far.
So, I went on writing. After a while I took a look into the PDF and saw, that the titles with the @ (the title started with it) had a line feed and was not, where it was supposed to be. Now Google had to solve my problem. Unfortunately Google couldn't solve my problem. The only halfway helpful result was a blog in which the author suggested to write the @ in math-mode, like $@$.
That worked for the title and the @ in the text. But, because of the math-mode, the @ wasn't as pretty as it should be.
That was the point when I got a little bit upset about LaTex. In general I like it, but that was really bugging me. Also, because it seemed to be such a small problem.

After even more wild combinations in Google and some time, I found the solution.
Simply write the @ and everything is fine. No escaping, no special command (like \texttrademark) and no import of some symbol packages.
Sometimes the solution is sooooo simple ;)


Copyright @ 2013 Wrong tracks of a developer.

Designed by Templateiy