Cambios en el IVA para las ventas en Google Play

euro

A partir del 1 de enero de 2015 entran en vigor nuevas reglas de IVA para la prestación de servicios TRE (Telecomunicaciones, Radiodifusión y TV, y Electrónicos) en la Unión Europea y afecta a las ventas de apps en Google Play. Anteriormente a las apps se les aplicaba en Europa el IVA del país desde el que eran vendidas, pero ahora se les va a tener que apicar el IVA de cada uno de los países en los que se vendan.

Hasta ahora éramos los desarrolladores europeos los que nos encargábamos de recaudar el IVA y pagarlo a la agencia tributaria de nuestro país, y con este cambio habría que pagar el IVA recaudado en cada país a cada una de sus agencias tributarias. Para simplificar este proceso se va a poner el marcha la ventanilla única (Mini-One-Stop-Shop o MOSS) que, aunque simplificaría algo el proceso, seguiría siendo complejo….

Google al rescate

Afortunadamente Google acaba de anunciar que a partir del 1 de enero se va a encargar de recaudar el IVA y presentarlo ante las agencias tributarias de los países europeos, liberando a los desarrolladores de esta responsabilidad:

https://support.google.com/googleplay/android-developer/answer/138000

Por lo tanto a partir de ahora es Google quien vende las apps directamente a los usuarios, y luego el desarrollador facturará a Google, de forma similar a como se facturan las ventas en Amazon Appstore. La diferencia es que en este caso se le factura todo a Google Inc. USA. como se entiende al leer las Condiciones de Servicio de Google Play.

También se cambiará la forma de incluir el IVA en los precios: hasta ahora se le sumaba el IVA al precio especificado por el desarrollador, ahora el precio final pasará a llevar incluído el IVA (Tax-Incusive-Pricing).

Puedes comentar este post en Google+.


Filmon: Free IPTV service

filmon

IPTV is in a great momentum. In Spain we saw the rise of a lot of platforms: Yomvi, MovistarTV, OrangeTV, Nubeox… mainly paid platforms, but I am only interested in channels in English and Filmon is a great (and legal) option to watch some of them for free.

Filmon offers more than 600 live channels. There are lots of crap, but others are quite interesting:

  • UK TV channels: BBC One, BBC Two, BBC Three, BBC News, ITV1, ITV2, ITV3, ITV4…
  • News channels: Al Jazeera, Bloomberg, Euronews, France24, Russia Today…

Filmon is free for SD resolution, if you want to watch it in HD and access to program recording you must pay a 15€/month fee.

You can can watch Filmon directly from their web page http://filmon.tv, or from their Android and iOS apps.

There is also an unofficial Kodi plugin (previously called XBMC) at SuperRepo.


Running Android apps inside Chrome

I couldn’t believe it when somebody told me: Google is running Android apps in ChromeBooks and some selected apps can be installed from the Chrome Webstore. It works with a Chrome extension that implements an Android virtual machine running over the Native Client (NaCL is a sandbox for running compiled C and C++ code inside Chrome). Find the latest games and apps on this website.

Based on this Google work, Vlad Filippov released an unofficial Chrome extension called ARChon (https://github.com/vladikoff/chromeos-apk/blob/master/archon.md) to allow this for all the desktop Chromes (Linux, Mac & Windows). This ARChon extension is a 100MB zip that must be unzipped and loaded into Chrome as an unpacked extension.

Then each Android APK must be converted to an unpacked extension with a Node-JS based tool, chromeos-apk (https://github.com/vladikoff/chromeos-apk) and loaded into Chrome. The generated extension contains the APK and some support files. Once installed, it appears as a regular Chrome app.

I tested all my Android apps and I was very surprised with the results, they load fast and run smooth. Some of my apps did not work because:

  • It does not support Google Play Services
  • It does not support apps using the Android NDK
  • It does not support GL_TEXTURE_CUBE_MAP in OpenGL ES (and my app crashes)

But I consider it SPECTACULAR. This opens a lot of new possibilities for Android, now running inside browsers like Flash, … and confirms my “theory” that Android is only a virtual machine (IMHO, the underlying SO is Linux :P).

You can comment this post in Google+.

chromeos-apk

Facturar en España las ventas de apps en Amazon Appstore

amazon_appstore

El caso de Amazon Appstore es algo diferente al de Google Play (que analizaba en este otro post) y bastante más sencillo, porque es Amazon quien vende las apps directamente al usuario y luego efectúa el pago de royalties al desarrollador.

Amazon separa las ventas realizadas en Amazon.com y las de cada uno de sus portales europeos (Amazon.co.uk, Amazon.de, Amazon.es, Amazon.fr y Amazon.it), enviando una transferencia mensual por cada uno de dichos portales. Se pueden ver fácilmente estos pagos desde la Developer Console en Reporting->Payments.

Los royalties de las ventas a través de Amazon.com se deben facturar a:

Amazon Digital Services Inc.
410 Terry Avenue North
Seattle, WA 98109
US

Es una exportación (IVA 0%) y por lo tanto irá en la casilla 60 del modelo 303 de IVA (exportaciones y operaciones asimiladas).

Los royalties del resto de portales europeos se facturan desde Luxemburgo:

Amazon EU Sarl
5 rue Plaetis
L-2338 Luxembourg
Luxembourg
VAT Registration Number: LU20260743

Yo las agrupo en una factura por mes con una línea por cada uno de los portales. En este caso es una venta intracomunitaria (también IVA 0%) que irá en la casilla 59 del modelo 303 (entregas intracomunitarias de bienes y servicios) y que se debe hacer constar en el modelo 349 con la clave “S” (prestaciones intracomunitarias de servicios).

Puedes comentar este post en Google+.

ACTUALIZACIÓN

Desde el 1 de noviembre de 2014 las ventas en Europa se pasan a facturar por Amazon Media EU:

Amazon Media EU S.à r.l.
5 Rue Plaetis
L-2338 Luxembourg
Luxembourg
VAT Registration Number: LU20944528


¿Cuánto queda de cada euro al vender una app en Europa?

Cuando me invitan a hablar sobre Android o sobre apps suelo siempre comentar algo de monetización y saco este gráfico:

vender_app_europa

Y como siempre genera bastante interés y es lo mas twitteado y a lo que mucha gente le saca fotos, voy a explicar de dónde salen estos datos.

Partiendo de que el usuario paga 1€ por la aplicación:

  • Primero se le quita el IVA, un 21% cuando se vende en Europa desde España. Si vendes fuera de Europa no se aplica IVA, por lo que el gráfico mejoraría un poco, pero sigamos con el caso de Europa.  Tenemos que 1€/1.21 = 0,8264€, por lo que 0,1735€ son de IVA. El IVA se quita antes que la comisión de la appstore.
  • Luego vienen Apple o Google y cogen su comisión, un 30% en ambos casos, por lo que el gráfico es válido para apps tanto Android como iOS. Entonces 0.8264€ x 0,3 = 0,2479€, y nos quedan 0,5785€
  • Y ahora están los pagos a la Seguridad Social y a la Agencia Tributaria. Variarán en función de la base de cotización y el volumen de facturación, pero estimando que anda sobre un 30%, es 0,5785€ x0,3 = 0,1735€
  • Entonces al desarrollador le queda 0,5785€ – 0,1735 = 0,4050€. Vamos, 40 céntimos, y aún habría que quitar inversión en equipos, alquiler de oficina, electricidad, etc.

Lo curioso es que pasa algo parecido si tienes un kiosco y vendes Chupa-Chups. Poca gente es consciente de los costes que conlleva vender o realizar cualquier actividad económica.

Para más temas fiscales sobre vender apps os recomiendo mi artículo Vender en Google Play desde España.


¿Son las apps una chapuza temporal?

mobile_apps

Sé que esto es tirar piedras contra mi propio tejado ya que yo me gano la vida gracias sobre todo a aplicaciones Android, pero no puedo dejar de pensar que el fenómeno de las apps móviles me recuerda a lo que pasaba hace 10 años en los ordenadores de escritorio, cuando teníamos que descargar una aplicación para Windows, otra para Mac… substitúyase esto por Android, iOS y Windows Phone… sí señor, aplicaciones de escritorio, ¿a que suena rancio?

¿Y por qué Google, que se supone tiene a los mayores expertos en web del mundo apoyó Android cuando tenía un sistema operativo basado en web como ChromeOS? Para mi la respuesta es que la web móvil no estaba preparada y los navegadores móviles no conseguían la suficiente potencia para simular una experiencia nativa. Y es que a día de hoy Android, mejor dicho, la máquina virtual java (JVM) Dalvik, sigue consiguiendo mejor rendimiento que los motores HTML5 móviles (que yo considero también máquinas virtuales), y aunque éstos mejoran día a día, debido a las limitaciones de Javascript (JS) es muy difícil que se aproximen al rendimiento de una JVM.

También podría ser que la mejora de las CPUs móviles haga que no importe el menor rendimiento de las aplicaciones web.

Y está el moviento extraño de Google con Dart. JS es malo, pero… ¿crearte un lenguaje nuevo tú sólo? ¿sin contar con ninguno de los otros actores? Google ya parece Microsoft en sus mejores tiempos ¿recordáis del malogrado VBScript para HTML? Puede ser que la gente de Google sí crea que el futuro está en la web, pero no con JavaScript.

Por otra parte estoy viendo decepcionado como Google se resiste a integrar la Chrome Webstore en Google Play, privándonos de poder publicar aplicaciones HTML5 para Android directamente (sin recurrir a chapuzas como PhoneGAP), también veo cómo Google y Apple siguen proporcionando WebViews del paleolítico capando APIs tan esenciales como WebGL ¿Y por qué? ¿Acaso abrir las puertas a las aplicaciones HTML5 es matar la gallina de los huevos de oro de las apps? Alguien en Cuppertino y en Mountain View debe pensar que sí.

Y aquí entra el, de momento fracasado, FirefoxOS. La gente de Mozilla sí ve claro el futuro en la web. FirefoxOS no es más que un Android al que le cambian la JVM Dalvik por el motor HTML5 Gecko. Tampoco me parece que FirefoxOS tenga mucho sentido ya que es más fácil instalar Firefox en cualquier dispositivo Android y se tiene igual acceso a todas las aplicaciones del Firefox Marketplace. Sin embargo, Firefox con su Marketplace es, en mi opinión, la mejor forma de distribuir y ejecutar aplicaciones HTML5 en un móvil. Pero Firefox está disponible sólo en Android, las políticas de Apple impiden explícitamente usar motores web que no sean el suyo, de nuevo… ¿miedo a las aplicaciones HTML5?

En los últimos 10 años hemos visto como las aplicaciones web substituían a muchas de las aplicaciones que usábamos cada día en nuestros equipos de escritorio, ¿sucederá esto con las apps móviles? Pues no lo sé, dejemos esto de adivinar el futuro para los programas nocturnos de las televisiones.


My Gradle Tips and Tricks

gradle_logo

The new Android build system is based in Gradle, an advanced build tool that simplifies build automation.

I used Maven for many years and Gradle project structure is very similar, but Gradle configuration files are Groovy-based and much (much!) more simple. Here is the official documentation

This week I migrated a lot of my Android and GWT projects to Gradle (some of them in my github), and here are some tips that I discovered (and I will add more as I find them):

Embrace the new Source Structure

Initially can be difficult, but putting the code under /src/main/java/, Android resources in /src/main/res/, etc. is a very popular form to organize the code. You can configure the build.gradle file to keep the old Android project structure, but I suggest migrating to the new structure.

Reference Another Project in your Workspace

You have two options:

  1. Use a Multi-Project Build
  2. Install the artifact (JAR if is a standard Java library, AAR if an Android Library) in your local Maven repo

Both options are explained below:

Use Multi-Project Builds

You can create a multi-project setup with projects on subfolders adding a settings.gradle file at the root with a include statement:

include 'library-project', 'your-project'

Then inside a your-project’s build.gradle you can easily add a dependency to another project (called “other_project”):

dependencies {
    compile project(':library-project')
}

Sample here.

Install a JAR to your Local Maven Repo (with the source code)

With standard java libraries and a build.gradle file like:

apply plugin: 'java'
apply plugin: 'maven'
group = 'com.company'
version = '0.8'

You can do “gradle install” to copy it yo your Maven repo.

Manually Install a JAR to your Local Maven Repo (without source code)

At the moment a lot of Google artifacts (=JARs, AARs) are not available at the Maven Central repo, but you can install them manually to your local Maven repo

mvn install:install-file -Dfile=android-support-v4.jar -DgroupId=com.google -DartifactId=android-support-v4 -Dversion=0.1 -Dpackaging=jar

You can also do it with gradle, but it is a bit more complex sample here.

Reference an Artifact from your Local Maven Repository

Be careful to add mavenLocal() to your repositories in the build.gradle:

repositories {
    mavenLocal()
}

Then use a normal reference, for the android-support-v4.jar sample above, it will be:

dependencies {
    compile 'com.google:android-support-v4:0.1'
}

Install an AAR to the Local Maven Repository

AAR is the new package format for Android Libraries. The “gradle install” task (that should install the AAR in the local Maven repository) does not works as expected in those projects, so I use a little hack:

apply plugin: 'maven'
uploadArchives {
  repositories {
    mavenDeployer {
      repository url: 'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath
    }
  }
}
task install(dependsOn: uploadArchives)

Usage sample here.

Android Library Projects need an Application Tag

This is an ADT bug, and the workaround is to add an empty application tag yo your library’s AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" ...>
    <application />

Include all the JARs in the libs/ Directory

This was the default behaviour of Android Projects, to maintain it you can add to your build.gradle:

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
}

I suggest referencing local JARs only in final Android projects, referencing them in libraries can cause problems, read below:

Avoid Referencing Local JARs in Android and Java Libraries

If you reference local JARs in Android libraries, those jars are going to be embedded in the AAR. If you reference again the JAR from a project that uses the AAR you will see this build error:

:project:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompatHoneycomb;
//..
1 error; aborting
:project:dexDebug FAILED

If an Android Library projects references a JAR library, and the JAR library references local JAR files, those local JAR files are not going to be embedded in the Android projects using the library.

The best solution is to install all the JARs to your local Maven repo as explained above.

Or Embed all the Dependency JARs Into your Library

In some situations you may embed all the JARs in your library, but ONLY if those dependency JARs are not going to be referenced again in a project that uses the library.

jar {
    from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}

Android Projects Need Libraries Compiled with Java 1.6

If in an Android Project you use a library JAR including classes compiled with source compatibility to Java 1.7, build gives this WARNING:

trouble processing:
bad class file magic (cafebabe) or version (0033.0000)
...while parsing Class

…and the class is not included in the APK, so the app force closes at running.

This may be solved adding in the build.gradle of the library:

apply plugin: 'java'
sourceCompatibility = 1.6
targetCompatibility = 1.6

Create a Source JAR for a Library

Source JARs are needed for libraries used in GWT projects. To generate them add this to your build.gradle:

apply plugin: 'maven'
//...
task sourcesJar(type: Jar, dependsOn:classes) {
    classifier = 'sources'
    from sourceSets.main.allSource
}
artifacts {
    archives sourcesJar
}

You can install them to your local repo with “gradle install”

Include a Source JAR from Another Project

For multi-project_builds:

dependencies {
    compile project(':other_project')
    compile project(path: ':other_project', configuration: 'archives')
}

Sample here.

Include a Source JAR from a Maven Repo

Simply append “:sources”:

dependencies {
    compile 'com.company:artifact-name:0.8'
    compile 'com.company:artifact-name:0.8:sources'
}

Coding in the Dark Side (with Eclipse!)

screenshotGetting back to the old days where I used Emacs to code (ok, more than ten years ago), now I’m using a dark theme in Eclipse. Dark themes are less eye-stressing and now are becoming popular with editors like IntelliJ, Sublime Text and the last Visual Studio. And that’s why more people is learning to programming even to his difficulty, although there are strategies that people can use to improve their learning, so you can use all the power of your mind to learn, you could visit http://www.subconsciousmindpowertechniques.com/ to find out more about this.

The Eclipse Juno platform supports styling of the SWT widgets via CSS, but many other elements must be setup manually, so I published my CSS and setup instructions in a GitHub repository: https://github.com/albertoruibal/eclipse_dark_css

Welcome to the dark side!


Chromium Embedded Framework

chromium

HTML5 is a fantastic app framework, but there are many environments where you cannot rely on the features support of the browser (specially when dealing against Internet Explorer, old windows versions or environments where you cannot freely upgrade the browsers). Recently I found this problem trying to package Mobialia Chess 3D for Windows 8. Microsoft provides some tools to package HTML apps to native apps, but they will run with the Internet Explorer engine, lacking features like WebGL, WebRTC, etc.

Chromium Embedded Framework (CEF) is a library that allows to embed a Chromium webview in your native Windows or Mac desktop application. So you can convert any HTML5 to a traditional desktop app (and I bet some users to try guessing if Mobialia Chess 3D is an HTML5 app). You can also create a Windows/Mac installer to  distribute the app (I used InnoSetup, but this is another story…).

Using CEF requires a small knowledge about Windows/Mac desktop app development. I created a Windows app using Visual Studio Express, it was not very difficult, because CEF includes a “cefclient” sample project that you can use as a template to start your project development.

The main problem that I found was the size, embedding CEF will add 45Mb size to your installed application. I also found other minor problems like the lack of mp3 sound support (due to license problems) solved converting the sound files to ogg.

CEF is already used by great desktop applications like Steam, Evernote or Spotify, so it’s a great option to consider in your developments.


Setting up the GoogleTV Emulator

Many people has problems with the Google TV Emulator because it hangs up booting at the Google TV logo. The problem is that it only works with specific device configurations and resolutions.

First you need to install the “GoogleTV Emulation Addon” using the Android SDK Manager. Then, create a new “Device Definition” (notice the new “Device Definition” tab at the top of the Android Virtual Device Manager in the lasts Android SDKs).

When prompted for the device definition parameters you must enter:

googletv1

This setup is for a 720p resolution, for a 1080p you must change the resolution to 1920×1080 and the density from tvdpi to xhdpi. Once the device definition is created, the next step is to create a new Android Virtual Device using it:

googletv2

Et voilà, our Google Tv emulator is up and running:

googletv3