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.

Another handy feature of the Chrome console is that you can influence the console output with CSS.



This feature is extremely useful in avoiding the overlooking of the important parts when you have a lot of text to display.


console.log("%cA cool line", "color: red; font-size: x-large");

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!




When I ported a Cordova app to Android 5 (Lollipop), I noticed, that the login does not work anymore. In prior versions of Android it works like a charm (app login is based on session cookies).

Part of the Android Lollipop changes:
Apps that target KITKAT or below default to allowing third party cookies. Apps targeting LOLLIPOP or later default to disallowing third party cookies.
https://developer.android.com/reference/android/webkit/CookieManager.html 
Android 5.0 changes the default behaviour for your app.
If your app targets API level 21 or higher:
The system blocks mixed content and third party cookies by default. To allow mixed content and third party cookies, use the setMixedContentMode() and setAcceptThirdPartyCookies() methods respectively.
The system now intelligently chooses portions of the HTML document to draw. This new default behaviour helps to reduce memory footprint and increase performance. If you want to render the whole document at once, disable this optimization by calling enableSlowWholeDocumentDraw().
If your app targets API levels lower than 21: The system allows mixed content and third party cookies, and always renders the whole document at once.
https://developer.android.com/about/versions/android-5.0-changes.html#BehaviorWebView

Indeed, if the app rely on session cookies it will stop working as expected.

However. Here is a fix to make session cookies work again on Android Lollipop and above:

/*
       Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you under the Apache License, Version 2.0 (the
       "License"); you may not use this file except in compliance
       with the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing,
       software distributed under the License is distributed on an
       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       KIND, either express or implied.  See the License for the
       specific language governing permissions and limitations
       under the License.
 */

package com.blogspot.tol8;

import android.os.Bundle;
import org.apache.cordova.*;
import android.os.Build;
import android.webkit.CookieManager;
import android.webkit.WebView;

public class MyApp extends CordovaActivity
{
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        super.init();

        // Allow third party cookies for Android Lollipop
        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
        {
                WebView webView = (WebView)super.appView;
                CookieManager cookieManager = CookieManager.getInstance();
                cookieManager.setAcceptThirdPartyCookies(webView,true);
        }
        super.loadUrl(Config.getStartUrl());
    }
}

BTW: Make sure that you use the latest Android SDK to compile the source code. I have also created an issue at the Cordova bug tracker (https://issues.apache.org/jira/browse/CB-8026).


Some years ago, I faced this bug in MySQL Workbench:
  1. Create a table
  2. Add a column with type datetime
  3. Go to the query editor
  4. Try to insert now() into the datetime field
Result: It will not work.

Reason, if you take a look at the query you will see the following:
`test_date`='now()'
Ok, the solution is easy, "now()" must be written without the single quotes. To do this type: 

\func now() 

instead of 

now()



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!


In this article I would like to show you how an app is published with multiple languages ​​to the Windows App Store.

As default, you can only select one default language on the Windows App Store. In order to add more languages, the language information must be added before uploading the XAP file.

In Visual Studio, go to Project Explorer > Solution > Project > Properties and open the WMAppManifest.xml file.

Switch to the tab "Packaging" and add the specific languages. Save the changes, rebuild the XAP file and upload it again. After uploading the XAP file, now you can select multiple languages.




In this article I would like to show you how to create a XAP file for the Windows App Store.

  1. Open MS Visual Studio
  2. Open your project
  3. Go to the "Project Explorer"
  4. Right click on the Solution > Properties
  5. Change the build properties as illustrated in the screen below
  6. Apply the changes
  7. Build your project ("F7")
  8. Make sure that the build was successful (console output)
  9. Open your project in the Windows Explorer and search for "*.xap". Choose the release version. Done.



Most of the lists in Sencha Touch are connected to a store. When the store only contains a small amount of records, performance is not a problem. However, when the store is filled with a big amount of records, it is very important that the data is added in an optimum manner.

Let's have a look at the following code:
copyObjects : function(objects) {
   var taskModel = null, 
       taskStore = Ext.getStore('Tasks');

   taskStore.removeAll(true);

   Ext.Array.each(objects, function (data) {
      taskModel = Ext.create('MyApp.model.Task', data);
      taskModel.setDirty(true);
      taskStore.add(taskModel);
   });
   taskStore.sync();
}
In the above example, 100 objects are added. Tested on a Samsung Galaxy II, the execution takes 12 to 14 seconds. It simply takes too long!

After further testing, I found out that the add function takes so much time (http://docs.sencha.com/touch/2.3.1/source/Store.html # Ext-data-store-insert method). Therefore, the solution is to call this function as less as possible. This can be done with a temporary array:
copyObjects : function(objects) {
   var taskModel = null, 
       taskStore = Ext.getStore('Tasks'),
       tmp = new Array();

    taskStore.removeAll(true);

    Ext.Array.each(objects, function (data) {
       taskModel = Ext.create('MyApp.model.Task', data);
       taskModel.setDirty(true);
       tmp.push(taskModel)
    });
    taskStore.add(tmp);
    taskStore.sync();
}
The execution time takes only one second now.

Advice: Pay attention that your list is not too long, because the scrolling performance will go down as well.


I think everyone who deploy a first app on Windows Phone is facing the same problem: The app is running fine, but where the heck are my icons?

Apparently there is an issue present in Windows Phone 8 that prevents custom font-faces from working when HTML and CSS are hosted locally.

So we came up with the first solution: Hosting everything remote. But really, this is not a solution, right?

After spending some more time on google, I found another solution: Including the font-file instead of the base 64 encoded font.

Sample Code:
@font-face {
 font-family: 'Pictos';
 src:url('fonts/pictos-web.woff') format('woff');
 font-weight: normal;
 font-style: normal;
}
However, this code never worked for me. Some user reported that it works, but the rest said that it doesn't work for them too or only for some and not all of their font files.

Finally I came up with another idea: When I cannot rely on the CSS font-face, then I'll go back to the roots and display pictures instead. Of course this costs more effort and is not as elegant as using icon fonts, but so far this seems to be the only safe solution to get it done.

Before we start, let me tell you that we don't have to modify any of the Java Script Code and it will not affect other platforms like Android or iOS.

If you are already working with Themes (what I would suggest you) then you can just place the new CSS code to your WP.scss

To reduce the CSS markup, I created a small mixin. In this mixin we set a new background image with height and width, also we replace the characters in content with an empty string:

@mixin wpIcon($name,$dim) {
  $url:"../images/wp/#{$name}.png";
  background: transparent url($url) 0 0 no-repeat;
  content: '';
  height: $dim;
  width: $dim;
  display: inline-block;
}

The sample code above requires that your images are located in "/resources/images/wp".

Replacing images is very straight forward, lets take a look at another sample which shows how to use this mixin:
/* Replace the checkbox checked icon */
.x-input-checkbox:checked ~ .x-field-mask:after {
  @include wpIcon(checkmark, 20px);
}

/* Replace the back button icon and add a second rule for back button pressed */
.x-button-back:before {
  @include wpIcon(arrow-left, 32px);
}

.x-button-back.x-button-pressing:before {
  @include wpIcon(arrow-left-pressed, 32px);
}
As you can see we just pass the image name (without the file extension) + a size to the mixin.

If you don't use the WP.scss yet you can add ".x-windowsphone" as an additional class to your CSS rule. This makes sure that the rule will only apply on Windows Phone.

I hope this trick help you to get your icons back on Windows Phone. Please let me know when you have even a better idea/solution for this problem.