Dandandin.net

 

Posts in Category: Android

The Android tutorials doesn't work?

Have you ever tried to follow the Android programming tutorials at developer.android.com?

The writer gives too much for granted, many examples do not work as written if you copy them with a simple copy&paste. To permit a simplified view of the code, the header is omitted and the overall vision of how methods and classes are placed is not very clear.

You might end up with errors as:

array cannot be resolved or is not a field

or

The method setOnItemClickListener(AdapterView.OnItemClickListener) in the type AdapterView<ListAdapter> is not applicable for the arguments (new OnItemClickListener(){})

etcetera.

So, I created a public Bitbucket repository where beginners can go and compare the code.

Some criticism to Android 4 (Ice Cream Sandwich)

I tried in the emulator the new Android 4, which was announced recently.

I must say that, compared to the previous versions, despite the new fancy graphics, it seems much more responsive, whereas the emulator is much slower compared to a mobile phone.

Defects? I found several, here's a summary:

  1. Until now you could put in silent mode from the lockscreen. Now that function has been replaced with a button to take a picture, just like in iOS 5. I understand that if Apple did it, it's probably a good idea to copy, but silent mode is much more useful than taking a picture. And that "take picture" button that is available in almost all cell phones has a reason to be, right?
  2. "Add Widgets" screen in the drawer. Well, this was definitely "inspired" by GO Launcher, but it is quite useless! There is already an add widget menu by holding down the finger on the desktop, why replicate this function? They could replace it with a list of running programs
  3. Applications in drawer will no longer flow in "Android style", but have an "iPhone style" with a black background as seen on iPhone OS 3. Why return to the past by copying from the competitor?
  4. The background does not scroll between screens with that parallax effect typical of Android, but it is a simple static background as with the iPhone. How nice...
  5. In all screens there is a search bar with Google as if the search button that they put on all the phones is useless. The bar is as wide as the entire screen. Why just don't put, a small icon in the corner for start a new search?
  6. The interface is very dark. Probably with a Super AMOLED screen is awesome, but with a normal screen like mine, it will be unreadable in the sun.

Of course there are also other advantages:

  1. 3G data counter is well integrated with the system. Farewell 3G Watchdog 
  2. Settings are more intuitive and accessible from the notification bar
  3. The wireless networks menu is nicer
  4. Better management of photos (although in 70% of cases, the manufacturer provides a different program to manage your photos, because the default one is too rough)
  5. You can disable apps. Once an app is disabled, it will be made invisible and will not be executed. Hurray! Finally, I can turn off some ass-programmed apps like Facebook and Skype, which are executed even if I do not use them!

LBE Privacy Guard: a must have for Android

If you have a phone or tablet with root access, you should definitely install LBE Privacy Guard!

This program acts as a filter to all applications, a window will appear to ask you whether or not to authorize the action.

The actions to be filtered are: phone calls, send SMS, access to contacts, network access, send your serial number or mobile number, send the GPS position.

It seems almost unnecessary, but helps a lot to find malicious applications!

Take, for example, Blob Blast, a malware that I found by chance.

First of all, let's explain how I found it: by clicking on a paid advertising into another unrelated application.

Why its programmer should spend money to advertise a free application that does not show even banner ads inside?

When we click on a banner advertisement, we must always consider the fact that for every click, are spent on average 30 cents. If 1000 people clicks the advertising, are being paid 300 euros. It means that the programmer expects to earn much, much more than 300 euro. But how he could make money if the application is free and does not show even banner ads?

With malware.

Let's see the permissions required when installing Blob Blast:

  • Services that cost you money:
    send SMS messages
    Allows application to send SMS messages. Malicious applications may cost you money by sending messages without your confirmation.
  • Network communication:
    full Internet access
  • Your personal information:
    read contact data
  • Allows an application to read all of the contact (address) data stored on your device.Malicious applications can use this to send your data to other people.
  • Phone calls:
    read phone state and identity
    Allows the application to access the phone features of the device. An application with this permission can determine the phone number and serial number of this phone, whether a call is active, the number that call is connected to and the like.
  • Storage:
    editing / deleting the contents of the SD card
  • Your Accounts:
    discover known accounts
    Allows an application to get the list of accounts known by the device.

Why a simple game like this, has permission to send SMS, read all the numbers and email contacts, go online and delete files on the sd card, when it should have no need to do that??

The answer comes to us with LBE Privacy Guard: When we open the game, we get told that the first thing the game does it to access the phonebook.

We want proof? If we disable the access to Internet, does not attempt to send the phonebook! It means that the game tries to access the Internet, and, only if it succeeds, tries to send the entire address book!

They probably want to sell user data to spammers, or, if the phone is in a particular country, send sms to premium numbers. For example, an application could subscribe you to some useless ringtone service with high weekly fee!

And so are all applications from Wee Cat Games! Forgotten Blocks, Tracy Says, Color Crash, are all malware! (Their contact details are also fake)

Here is an example of their ad:

 

I have already reported the problem to Google, hoping for a quick solution. Meanwhile, root your phone, install LBE Privacy Guard, it's free, and be more careful when you install an app

Install the Android SDK in Windows FLP

Just for fun, I tried to install the Android SDK in Windows FLP (Fundamentals for Legacy PCs) that's a "secret" stripped down Windows XP version optimized for slow computers.

If you try to install the Android SDK on Windows FLP, you will get an error like "can't find a suitable Java JDK, or can't find Java SDK in your path, even if you installed it, making it impossible to download vital files.

At the first check, the one during the setup, just press "back" and then "next" again, and you can pass the check, but at the second one, there is not an evident workaround... let's find it!

The second check runs the content of C:\Program Files\Android\android-sdk\tools\lib\find_java.bat , so, if you open it, you can see which command will cause an error:

%java_exe% -version 2>nul

In this command the output is redirected on the null device, that means: if the command does not give an error, it is not shown to the user.

The problem is that on Windows FLP the null device is not implemented, so the command returns an error, letting the batch fil misinterpretate the detection.

So, if you delete 2>nul, the Android SDK will work great!

Now, if I could manage to let Titanium Studio recognize the SDK...

When piracy means a lost sale

Many developers thinks that a pirated copy of their app means a lost sale.

Actually, it's not like that. People have various reasons for pirating an app, for example trying them just for fun.

In fact, in most cases, a very few people will do a very long search on the net to get a $1 application for free.

In my opinion, if an app has an high piracy/sales ratio, it means that for "honest" customers, the product does not offer the right appeal, and for pirates it's just a trial, that means, they still won't buy your $1 app - it's not a lost sale.

The perfect example it's Walk and Text for Android, an app for texting while walking: it just displays the camera on the screen while walking; nothing exceptional here. To be honest, I won't get such kind of useless app even if it's for free. So, "honest" people won't buy the app because they feel the uselessness; while compulsive pirates will download it just for showing to friends "hey, I can text and walk". If you watch it in another way, the pirate will spread the voice between friends. Every "heavy pirate" that I know, loves to show off the fact their hundreds of useless apps.

This means that, sometimes, piracy sometimes can lead to a sale.

But, if you act recklessly like the developer of Walk and Text for Android, that acts like a virus if cracking it's detected, you generate a lot of bad advertisement: "hey, that app will bill me $$$ if detects a crack, better avoid it like a skunk!

In this case, piracy really means a lost sale.

Android: How to disable the GSM radio and force to use the UMTS band

Recently i bought an Android handset, coming from a Windows Mobile device, I am extremely happy with it, as I find it way faster and complete than the other. Once I get spoiled by the care of details, and easiness of software, I decided that I won’t come back to Windows Mobile again (I’d rather use a dumbphone ).

Unfortunately, my operator requires that the device is locked on the HSDPA/UMTS band, otherwise will connect on the roaming network, making a trouble for my wallet.  On my Windows Mobile device this wasn’t a problem, there is an option to select which band use, but on Android apparently the user has only the choice to do:

  1. Disable data communication while roaming
  2. Disable the UMTS radio

The third option, “Disable the GSM radio” is missing? No, it’s just hidden! To find it, we need Any Cut, an application that can create on the dashboard a shortcut to almost anything. So, after installing it, let’s create a shortcut to “Phone Status”, and then open it. Scrolling down we will see an option “WCDMA preferred”, (that means “If there is UMTS signal I’ll use it, otherwise I’ll go GSM”). By switching it in “WCDMA Only”, we will completely disable the GSM radio.

Even if I tried this only with my HTC Dream (T-Mobile G1), it should work on any other Android device such as the HTC Magic, Hero, and the upcoming Motorola Milestone and Acer Liquid. Of course it won't work with CDMA-only devices as the Verizon Droid or the Droid Eris

Page 2 of 2 << < 1 2
https://old.dandandin.net/Blog/ViewCategory.aspx?cat=15&pageid=1&mid=2&pagenumber=2