Posts

Showing posts from April, 2011

iPhone and Android smartphones track and store your locations

Got an iPhone or iPad ?
You would be surprised to know that iPho is regularly tracking down your location. What makes the situation more worst and worrying is that is the file is unencrypted and unprotected, and it's on any machine you've synched with your iOS device. Anybody with access to this file knows where you've been over the last year, since iOS 4 was released. http://goo.gl/YfVwz

Is it really dangerous? May be not, look at following link for more information: http://goo.gl/XidQY

Android is tracking your location too:
A security researcher has discovered that smartphones running Google's Android operating system are tracking users' locations and storing that data in files on the phone. This news comes only days after it became widely known that a similar file on Apple's iPhone also logs a complete history of users' travels by way of timestamped latitude and longitude coordinates.

Two files called cache.cell and cache.wifi located in the /data…

How to execute service once every day on Android?

I am trying to search for a solution which can help me execute a task every day on Android once on predefined time. I found a link which might help.
Link: http://stackoverflow.com/questions/3020405/android-having-a-service-run-every-day-at-4am

I am still working on the solution. Lets hope above link helps.

Why do you get android.os.NetworkOnMainThreadException?

This exception is only thrown for applications targeting the Honeycomb (Android 3) SDK or higher. Applications targeting earlier SDK versions are allowed to do networking on their main event loop threads, but it's heavily discouraged. See the document Designing for Responsiveness. See API documentation at below link for more information:

Link: http://developer.android.com/reference/android/os/NetworkOnMainThreadException.html

The exception that is thrown when an application attempts to perform a networking operation on its main thread.

How to fix it?

You must either use a handler or a AsyncTask. Check out this site for tutorials (http://www.vogella.de/articles/AndroidPerformance/article.html).

I used the AsyncTask method. I created a CustomAsyncTask class, Extended AsyncTask class and just put everything inside the doInBackground(String[]) method. Once created, a task is executed very simply: newCustomAsyncTask().execute(...);
It till need to fine tune my logic to work w…

How to remove App from Android Emulator

First,make sure the emulator is running. Then follow below steps:
1. go to tools directory in command
2. adb shell
3. cd /data/app
4. ls (It will display all the .apk installed in your emulator)
5. rm ***.apk(which you want to remove)
6. exit

One more way is to delete the Andoird image file which looks like “userdata-qemu.img” and at can be found in “C:\Users\\AppData\Local\Android”.

The other option is enable “-wipe-data” param in your emulator start up profile.

How to make Android Emulator Run Faster?

I noticed Android emulator startup was very slow. Even after starting, navigating apps was also slow.

I tried following tweaks on Android 3.0 (HoneyComb) emulator to speed up the emulator but above tweaks should work on any android emulator which supports snapshots.

I was looking for the solution and I learnt following few good tricks from Android blogs:
Use this options whilte starting eumlator:
emulator -cpu-delay 0 -no-boot-anim -cache ./cache -avd avd_name

or emulator -cpu-delay 0-no-boot-anim -cache ./cache -scale 0.8-avd avd_nameYou can also use Android Snapshot feature described here.

Or you can follow below steps to enable snapshot feature:
When creating (or editing) an AVD, tick the 'Snapshot enabled' box.The launch dialogue for a snapshot-enabled AVD will offer additional 'Launch from snapshot' and 'Save to snapshot' options.The first time a snapshot-enabled AVD is launched, there is no snapshot data so it will boot normally. Pressing the close butt…

Sharing learnings I had while working on Microsoft Sync Framework 4.0 (CTP)

Recently, I started using Microsoft Sync Framework 4.0 (CTP). I faced many issues in the begining when I was configurating it. There were some basic doubts in my mind about what it can do and what it can not do. Basically, what should I expect from it.

Following are list of questions (FAQs) I had and answers I found from Sync documentation, official forums and blogs:
Does Microsoft Sync Framework 4.0 need to talk to SQL Server directly? Is it possible if I introduce SOA layer between Microsoft Sync Framework 4.0 and SQL Server?yes it needs to. it needs to ask the database server what to sync. if you dont want to use the built-in providers, you can write your own, but then, Sync Fx will still need to talk to your provider and your provider to SQL. the WCF-based sync service already provides a good abstraction to the back-end database such that the client need only know the service and not where and what the database is. How can Android talk to Microsoft Sync framework?No, we just didnt hav…