Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Recently Cordova developers were informed by Google over security vulnerabilities:

Google Play warning: You are using a vulnerable version of Apache Cordova

Hello Google Play Developer,
Your app(s) listed at the end of this email utilize a version of Apache Cordova, an open-source mobile development framework, that contains one or more security vulnerabilities. If you have more than 20 affected apps in your account, please check the Developer Console for a full list.
Please migrate your app(s) to Apache Cordova v.4.1.1 or higher as soon as possible and increment the version number of the upgraded APK. Beginning May 9, 2016, Google Play will block publishing of any new apps or updates that use pre-4.1.1 versions of Apache Cordova.
The vulnerabilities were addressed in Apache Cordova 4.1.1. If you’re using a 3rd party library that bundles Apache Cordova, you’ll need to upgrade it to a version that bundles Apache Cordova 4.1.1 or later.
To confirm you’ve upgraded correctly, submit the updated version to the Developer Console and check back after five hours. If the app hasn’t been correctly upgraded, we will display a warning.
For information about the vulnerabilities, please see this Google Help Center article. For other technical questions, you can post to Stack Overflow and use the tag “android-security.”
While these specific issues may not affect every app that uses Apache Cordova, it’s best to stay up to date on all security patches. Apps with vulnerabilities that expose users to risk of compromise may be considered Dangerous Products in violation of the Content Policy and section 4.4 of the Developer Distribution Agreement.
Apps must also comply with the Developer Distribution Agreement and Content Policy. If you feel we have sent this warning in error, contact our policy support team through the Google Play Developer Help Center.
Regards,
The Google Play Team
©2016 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
Email preferences: You have received this mandatory email service announcement to update you about important changes to your Google Play Developer account.

Affected App(s) and Version(s): ...
Lets face it, Google is forcing Cordova developers to update their Cordova apps, otherwise it is impossible to release any updates after May 9, 2016 in the Google Play store.

To check the current Android platform version:
$ cordova platform version android

One of the biggest changes while upgrading the Android platform is probably that the minSdkVersion has been switched from 7 to 14.

For more details, check this link too.

To upgrade, enter:
$ cordova platform update android@4.1.1

From my personal experience with Cordova, I recommend you to check the whole app carefully after every update. Make sure everything work like expected.

How to take simulator screenshots for Android is a frequently asked question. There are many ways to do it, but I'd like to show you the easiest and quickest way for Windows and OS X.

I assume here, that you have already installed the Android SDK. If not, you can install it from https://developer.android.com/sdk/index.html

Ok, now just start your simulator as usual. After your simulator is already up and running, go to the Android SDK folder/tools and start the monitor tool (or just search for monitor in the SDK folder).

In the Monitor tool, when you look at the toolbar you have a screenshot icon there. Click and voila, there you are!



https://play.google.com/store/apps/details?id=com.jappster.countmoomoo

MooMoo counting is a fun counting app for family. Wanna teach your kids how to count while playing with them? Then this is just the right app for you. We have counting modes that can make it challenging enough for the whole family.


Device privileges
Count with MooMoo app runs with a minimum of privileges. No data will be transferred from Count with MooMoo to any server or any third party. The app only require an Internet connection to display advertising.

Tally Marker


https://play.google.com/store/apps/details?id=com.jappster.TallyMarker

Count with Tally Marker is a counter app, that allows you to count everything with tallies.

Imagine you went to a bar one day, order beers after beers until the end you lost track of the number of beers you have ordered and the total price for the bill. 
This is when Count with Tally comes to the rescue. Download the app, make a stroke every time you ordered a beer (or anything you can think of) and preset the price per beer in the settings. Now you can track how many you beers have ordered as well as their total prices. You can even track when you have ordered that beer.

Use this counter to
★ Count cups of beer you drank in the bar
★ Count the mistakes that you significant others have made
★ Count the cigarette you have smoke in a day/week/month
★ Count the money you have to pay for the items you count
★ Count any other things you might think of

Tally Marker Features:
★ Add new counter tallies by name
★ Get an actual count overview
★ Display additional price information in your preferred currency
★ Edit your counter tallies
★ Remove and reset counter tallies
★ Count up and down just by swiping
★ Automatic offline saving. Means all your count data is "always" saved offline
★ Initial filling of the newly created tallies(counts)
★ Personalise your tallies! Change them to your favourite color (Requires Android 4.4+)
★ Vibrate on count/swipe (optional)
★ Set default currency for your counter
★ History tracking of your counts

Device privileges
Count with Tally Marker runs with a minimum set of privileges, because Tally Markers mission is to count, nothing else. Tally Marker only require an Internet connection to display an interstitial ad on startup. That's it. Have fun counting!




Today I will tell you how to get reliable geolocation data on Cordova or Phonegap. It took me a lot of time to figure all this out, so I hope that I can save you some precious time with my article.

Note: I tested on Cordova 3.4.x and Android/WindowsPhone.

Before we start, make sure that you have not installed the Cordova or Phonegap geolocation plugin! In case you already have, remove it with the following command "cordova plugin remove org.apache.cordova.geolocation". We do not need this plugin since the native HTML5 support is much better! Further information can be found here. I don't know why this plugin is still available in the official documentation... But don't worry if you come from Cordova or Phonegap, you don't have to change a lot in your existing code (maybe you have to eliminate the frequency attribute).

Please pay attention that, also when you are not using the geolocation plugin, you have to set the following privileges in your:

AndroidManifest.xml

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
WPAppManifest.xml

<Capabilities>
               <Capability Name="ID_CAP_LOCATION" />
</Capabilities>
The code for the implementation itself is relative trivial. I would suggest you to implement it after the following action plan:

  • Before you do anything, check if geolocation is available (navigator.geolocation)
  • Try to get the current position with high accuracy, if the request timed out or an error occur > fallback to lower accuracy.
Important parameter:
  • enableHighAccuracy: true/false for high or low accuracy
  • maximumAge: Accept a cached position whose age is no greater than the specified time in milliseconds. (Number)
  • timeout: Maximum time of lenght in ms to get the position.
  • frequency: Stop using this attribute. It is not W3C compliant. Use maximumAge instead!
Suggested values:
  • enableHighAccuracy: true, maximumAge:3000, timeout: 5000
  • enableHighAccuracy: false, maximumAge:3000, timeout: 30000

Tips:
  • If you want to update your geolocation data continuously, use watchPosition(...) instead of getCurrentPosition(...). Also use the pause/resume functions of Cordova/Phonegap to start/stop the watch while the application is or return from background. The users battery will thank you.
  • Keep in mind that the logic behind getCurrentPosition(...) and watchPosition(...) is differently on different devices. So test your implementation as much as you can!


Please let me know if this article helped you to improve your geolocation results. If you tested successfully with iOS drop a comment (ideal with required privileges) as well. Thanks!


This article focuses on how to support SQLite (Web SQL) on the following platforms:
  • Android
  • iOS
  • Windows Phone

Why should a SQLite Plugin used in Cordova?

  • To follow the HTML5 Web SQL API as close as possible.
  • To support Web SQL on Windows Phone.
  • To deal with the same javascript functions on every platform.
  • Fail-safe nested transactions with batch processing optimisations.
  • Keeps sqlite database in a user data location that is known, can be reconfigured, and iOS will be backed up by iCloud.
  • Works with SQLCipher for encryption.

  Limitations of SQLite on Windows Phone

  • Drop table is not working, seems like a bug in the .NET or C# SQLite library. To work around this, empty the table instead of dropping it.
  • A high number of features in C# SQLite are disabled.
  • Missing failure-safe transaction mechanism.
  • Not (yet) working with SQLCipher for encryption.

What do I have to change in my existing applications?

Not much.

Just replace "window.openDatabase" with "window.sqlitePlugin.openDatabase".

Don't forget to take a look at the limitations of Windows Phone Plugin.

How to install the SQLite Plugin

There are so many SQL Plugins available. I choose "lite4cordova", because it supports Cordova 3.x, it is easy to install and it is still in development.
  • https://github.com/lite4cordova/Cordova-SQLitePlugin
  • https://github.com/lite4cordova/Cordova-SQLitePlugin-WP-2013.12
The second project is an extension of "Cordova-SQLitePlugin", because Windows Phone is not working on "Cordova-SQLitePlugin" yet.

Windows Phone 8

If you are starting to develop for Windows Phone, have a look at this article first.

To setup the project, type the following commands in the command line:
$ cordova create hello com.example.hello Hello
$ cd hello
$ cordova platform add wp8
$ cordova plugin add https://github.com/lite4cordova/Cordova-SQLitePlugin-WP-2013.12.git

Remove all files in "hello/www", except "config.xml".
Copy the testfile to "hello/www".

To build the project type the following commands in the command line:
$ cd hello
$ cordova build

Finish! Open and run the project, execute the testfile to see if all works fine.

Android and iOS

To setup the project, type the following commands in the command line:
$ cordova create hello com.example.hello Hello
$ cd hello
$ cordova platform add android
$ cordova platform add ios
$ cordova plugin add https://github.com/lite4cordova/Cordova-SQLitePlugin.git

Remove all files in "hello/www", except "config.xml".
Copy the testfile to "hello/www".

To build the project type the following commands in the command line:
$ cd hello
$ cordova build

Finish! Open and run the project, execute the testfile to see if all works fine.
Maybe you received  the following error while building a Sencha Architect application:

Error: The package command has moved to 'sencha app package'

This error is thrown because Sencha Architect 2.1 only works with Sencha Cmd 3.0.0 version.

To fix this you have to download and refer one of the following Sencha Cmd 3.0.0 versions:

http://cdn.sencha.com/senchacmd/SenchaCmd-3.0.0.250-linux-x64.run.zip
http://cdn.sencha.com/senchacmd/SenchaCmd-3.0.0.250-linux.run.zip
http://cdn.sencha.com/senchacmd/SenchaCmd-3.0.0.250-osx.app.zip
http://cdn.sencha.com/senchacmd/SenchaCmd-3.0.0.250-windows.exe.zip
Today my phone has been eating my battery life like crazy. After some google searches I came arround that it is might be caused by a bad file or corrupted sd-card. I also unmounted my sd-card, but so far this was not the solution for my problem...


A quick hack for this problem is to kill the media service via a script.

If your phone is rooted, you can install a program that can run shell scripts like Script Manager - SManager on your phone.

Then run the following script to kill the media service:
#!/system/bin/sh
killall -9 android.process.media
killall -9 mediaserver

Baaaaam! :)

If you have any idea how I find out what file or error is causing my media service to crash, don't hesitate to contact me.


If you are sitting behind a proxy server you will probably have no internet connection in your Android emulator.

Solution: To configure your specific proxy settings, open Eclipse -> Run Configuration> Android Application > App > Target > Additional Emulator Command Line Options and add:

-http-proxy http://PROXY_PORT:PROXY_PORT