Two simple ways to make your users aware of incorrect input

Did you ever enter a wrong password and got an AlertDialog telling you that you entered something wrong? You probably did and you probably also noticed that this alert dialog most likely takes one more click to continue, a click that could be saved. One way to avoid the AlertDialog are Toasts. Here are two nice but rarely used other ways to tell your users that they should enter something different.

Setup

Let’s assume we have an EditText which we use in our UI.
EditText mEditText ;
//...
mEditText  = (EditText ) findViewById(R.id.myEditText );

Furthermore we have a method showError() which we call when the EditText contains invalid data.

1 Shake

A nice way to show the user that, for example, an entered password was incorrect is to shake the EditText. Please note that I took this code from the official ApiDemos and modified it slightly.

First, we have to define our shake animation. Go to your res folder, create the subfolder anim and place a file shake.xml in it. In this file, create a translation like this:
< translate xmlns:android="http://schemas.android.com/apk/res/android" android:fromXDelta="0%" android:toXDelta="5%" android:duration="1000" android:interpolator="@anim/cycle_7" />

TranslateAnimations let us move views ond the x or y axis of our screen. Since we want to shake it from left to right, we only apply the translation on the x axis. We move it from zero percent of the view’s width to five percent of the view’s width and let the translation last one second (1000 ms). Furthermore, we use the interpolator cylce_7 wich is placed in anim/cycle_7.xml and looks like the following:
< cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android" android:cycles="7" />

It’s a simple CycleInterpolator. This kind of interpolators express the number of repetitions an animation should do. In our case, we repeat the animation seven times.

Now we only need to apply our shake animation to our EditText every time something incorrect is entered. We can do it like this:

private void showError() {
Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);
mEditText.startAnimation(shake);
}

That’s it. Super easy, super smooth integration into the UI.

2 SetError

This is my personal favourite. It is the setError()-method which comes out of the box with the EditText view. When calling this method, the right hand compount drawable of the will be set to the error icon. When the EditText also has focus, the text you gave to setError() will be shown in a popup. If you don’t like the default error icon, you can also use setError(CharSequence error, Drawable icon) to set your own icon. The routine to show errors can then look like this:

private void showError() {
mEditText.setError("Password and username didn't match");
}

Which will result in errors shown like this:

setError() on ICS

setError() on ICS

Which looks good, catches the user’s attention and doesn’t need any extra clicks to disappear.

Conclusion

Showing errors without interrupting the user flow can be accomplished easily on the Android plattform. For even more attention by the user, the two methods mentioned can also be combined.

 

Please feel free to share your methods of showing error messages in the comments.

Categories: Development - Easy, Tutorial | Tags: , , , , | 2 Comments

Android Income Report #12: April 12

Edit: I totally forgot to mention this: Marc Galeazzi put together a list of income reports, maybe that’s some interesting data for you.

April is over, time to sum things up. I’m quite late this time, I apologize for that.

If you are new to this series, let me explain it to you: Since Android is an open platform, I decided to be open about the income I’m making with my private Android apps too. In the last report I aimed to reach $4,000 for the last month. You will see if it worked out.

For all income reports, please click here.

Which Apps?

3D Invaders – about 245,000 installs (+13k), 15% active

AL Voice Recorder – about 740,000 installs (+40k), 20% active

AL Voice Recorder Ad Free – 1046 installs (+49), 35% active

Droid-Blog.net Android App – 477 installs (+24), 13% active

SmsToSpeech full – 759 installs (+15), 30% active

Only 53K new downloads. As you will see, there was a reason for that.

What did I do?

I tried a new ad network, SellAring, in the AL Voice Recorder. SellAring is an ad network specialized in audio ads. These ads are played in the timeframe the user is waiting for a called person to pick up a call. It needs at least four permissions, five other permissions can be added to increase efficiency.

The overall performance of the network was not satisfying. The fillrate started high but dropped fast. In addition, the new permissions stopped a lot of users from downloading the app which again resulted in a worse position on the result page for “Voice Recorder” in the Play Store. The users that updated or downloaded the app also didn’t like it, the comments were clear about that. On the pro side is the fast payment. It happened a couple of days after the month’s end.

By today, I’m not using SellAring anymore.

Advertising Stats

Here are some statistics from the two advertising networks I’m using, AdMob and Madvertise. Please read the second income report for an explanation of the following numbers.

AdMob:

Requests: 591,169 (-95k)

Impressions: 581,342 (-92k)

Fill Rate: 98.34% (0.26%)

Clicks: 24,579 (-5.8k)

CTR: 4.23% (-0.3%)

eCPM: $1.56 (-$0.52)

House Ads: 741 (554)

Adjusted Requests:  591,910 (-95k)

Adjusted Fill Rate: 98.21% (+0.16%)

Madvertise

Requests: 1,357,737 (-193k)

Impressions: 106,949 (12k)

Fill Rate: 7.88% (1.76%)

Clicks: 3,603 (598)

CTR: 3.37% (0.2%)

eCPM: $5.76 ($2.75)

madvertise’s fillrate and eCPM got up a little again which is somewhat good news. The overall requests declined, I think this can be attributed to the SellAring integration.

How much?

Here are the numbers:

AdMob:

3D Invaders: $348.46

AL Voice Recorder: $557.95

AdMob Total: $906.41 (-$497.45)

 

madvertise:

3D Invaders: ~$477.57

AL Voice Recorder: ~$138.11

madvertise Total: ~$615.68 ($330.10)

 

Market sales: ~$84.32 (-$42.27)

In-App purchases: ~$9.59 ($1.65)

SellAring: $174.35

Total: ~$1,790.35 (-$33.61)

 

What’s next?

I’m still as far from the goal of $4,000 as I was in the last months. To be a bit more realistic, I will set my goal for this month at $2,000.

 

Please feel free to share your own experiences and hints in the comments. Ask questions, share, do whatever you like.

Categories: Money & Income | Tags: , , , , , | 29 Comments

How to add attributes to your custom View

Jack just asked the following questions on the tutorial for animated GIFs I once wrote:

“I want to be able to place the GifMovieView in an existing layout (like any regular control).
Please give me a step-by-step of how to bind xml layout attributes to this custom view.”

A good question. Here’s the answer.

1 Use your own View in an XML

To place your own View in an layout XML file, just use it like a normal view, only that you have to append the whole package name up front. Something like:

< eu.andlabs.tutorial.animatedgifs.views.GifMovieView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/my_id"
/>

In this XML, you can already use the standard Android attributes.

2 Define your custom attributes

If you want to define your own, custom attributes, go to the res/values-folder and create a file called attrs.xml.

You can define your custom attributes here. In the end, it should look like this:

< ?xml version="1.0" encoding="utf-8"?>
< resources>
< declare-styleable name = "eu.andlabs.tutorial.animatedgifs.view.GifMovieView">
< attr name="url" format="string" />
< attr name="fetchAutomatically" format="boolean" />
< /declare-styleable>
< /resources>

You can now address these attributes in your XML layout. To do so, add something like

xmlns:gif="http://schemas.android.com/apk/res-auto"

To your root layout element. Please notice that this only works with ADT 17 and older. Now you can access your attributes in your layout like this:

< eu.andlabs.tutorial.animatedgifs.views.GifMovieView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/my_id"
gif:url="http://mygif.com/mygif.gif"
gif:fetchAutomatically="true" 
/>

3 Handle the attributes in your View

Since the XML is done, it’s time to address the Java part, which means the custom View. You should at least overwrite the constructor that is receiving a Context and an Attributes-object. Like so:

public GifMovieView(final Context context, final AttributeSet attrs) {
super(context, attrs);
init(attrs);
}

You can now access your custom attributes in using the AttributeSet:

private void init(final AttributeSet attrs) {
if (attrs != null) {
String packageName = "http://schemas.android.com/apk/res/res-auto";
mUrl = attrs.getAttributeValue(packageName, "url");
mFetchAutomatically = attrs.getAttributeBooleanValue(packageName, "fetchAutomatically", false);
}
}

Do whatever is needed with it. That’s already it.

 

I hope you enjoyed this post. Please feel free to ask anything you want in the comments.

And remember: Sharing is caring!

Categories: Development, Development - Intermediate, Tutorial | Tags: , , , | 3 Comments

The AndEngine PhysicsEditor Extension

[Update] Now supports circle sprites. Also, Andreas Löw, the creator of PhysicsEditor will link to it with the next update of the editor. [/Update]

If you ever created a physics game, for example with my favorite game engine, AndEngine, and wanted to produce a polygonal body, you probably did something that sucked big time. Something like defining your vertices in code. This is

  1. Dirty
  2. Really painful
This is why we looked around and found the PhysicsEditor, a simple to use tool to create an output that describes physic definitions. While iOS integration seemed to work both from the editor into the code, it only provided an AndEngine Exporter-format, but no tool to integrate it back into the engine.
Until today.

 

Capabilities

Here is what it’s capable of:
  • Definitions of (multiple) bodies
  • Definitions of (multiple) fixtures
  • Definitions of polygon shapes
  • Definitions of circle shapes
  • Definition of density, friction and elasticity
  • Definition of dynamic and non-dynamic bodies
  • Definition of sensor and non-sensor fixtures
  • Collision filtering
  • Automatic setting of a body’s user data

 

How to use it

For this part I assume you already know the very basics of AndEngine development. Let’s start from the beginning.

First, download the PhysicsEditor. Open it and import your sprite of choice. I chose the star from the examples project:

Now, draw your physical representation. You might want to use the Shape tracer for that (the wand icon):Now make your settings on the right

and push ‘publish as’. Save your XML somewhere.

Next, it’s time to get the source. Clone the repository using something like git clone git://github.com/ANDLABS-Git/AndEngine-PhysicsEditor-Extension.git. Import the source. Now, make sure you also have the AndEngine and the AndEnginePhysicsBox2DExtension in your workspace. You may have to update this dependencies.

A good match: PhysicsEditor Extension, Box2D Extension, AndEngine and PhysicsEditor Examples

A good match: PhysicsEditor Extension, Box2D Extension, AndEngine and PhysicsEditor Examples

Now in your project, create a new PhysicsEditorLoader-object using the default constructor:
final PhysicsEditorLoader loader = new PhysicsEditorLoader();
Use it to load whatever you want:

try {
loader.load(this, mPhysicsWorld, "xml/", "star.xml", star, true, true);
} catch (IOException e) {
//...
}

The parameters provided are a Context, the PhysicsWorld you want to attach your body to, the base path, the path to your specific definition, the IAreaShape (for example a Sprite) you want your definition to be connected to, whether you want your object’s position to be updated and whether you want your object’s rotation to be updated. And that’s it.

There are some other use cases covered like drawing lines for debugging or loading multiple definitions, but that’s not more than about five keystrokes of additional work. You can take a look at the examples to see what I mean (in case you are curious).
It is possible to use the PhysicsEditor as a tool for level creation. In fact, it enables you to actually ‘draw’ your levels in your graphics tool of choice. Please keep in mind though that the maximum size of an IAreaShape in AndEngine is 2048 pixels, so you may want to use multiple sprites to achieve big levels. Also, memory is low on mobile devices, depending which device your are targeting, you maybe want to think about using a different method than this.

 

A ball jumping on a polygonal physical representation

A ball jumping on a polygonal physical representation

Please keep in mind that this is a very early release that may still contain some bugs and needs some refactoring. Please feel free to leave any issue you discover in the project’s issue tracker.

So far, we have tested the four sample projects on the following devices:

  • Samsung Galaxy Y (2.3.6)
  • Nexus One (2.3.6)
  • Galaxy Nexus (4.0.4)
Categories: Development, Development - Easy, Tutorial | Tags: , , , , | 13 Comments

Android Income Report #11: March 12

March is over, time to sum things up.

If you are new to this series, let me explain it to you: Since Android is an open platform, I decided to be open about the income I’m making with my private Android apps too. In the last report I aimed to reach $4,000 for the last month. You will see if it worked out.

For all income reports, please click here.

Which Apps?

3D Invaders – about 231,000 installs (+18k), 15% active

AL Voice Recorder – about 700,000 installs (+48k), 20% active

AL Voice Recorder Ad Free – 1013 installs (+49), 35% active

Droid-Blog.net Android App – 455 installs (+24), 13% active

SmsToSpeech full – 755 installs (+15), 30% active

14K less downloads than in February, a slow decrease regarding the growth but still fine.

What did I do?

Nothing new.

Advertising Stats

Here are some statistics from the two advertising networks I’m using, AdMob and Madvertise. Please read the second income report for an explanation of the following numbers.

AdMob:

Requests: 686,761 (-5k)

Impressions: 673,586 (-7k)

Fill Rate: 98.08% (-0.28%)

Clicks: 30,474 (+10.2k)

CTR: 4.52% (+1.56%)

eCPM: $2.08 (+$0.79)

House Ads: 187 (-2,309)

Adjusted Requests:  686,948 (-7.5k)

Adjusted Fill Rate: 98.01% (+0.03%)

Madvertise

Requests: 1,551,268 (+369k)

Impressions: 94,877 (-48k)

Fill Rate: 6.12% (-6.02%)

Clicks: 3,005 (-1,731)

CTR: 3.17% (-0.14%)

eCPM: $3.01 (-$2.23)

AdMob performed awesome with an incredible CTR, I assume this is because of better ad content. madvertise sucked big time this month with only 6% fillrate, which is really not satisfying. Because their developer fund ended, a 40% cut applies to all earnings which causes the big loss in the eCPM. Its still slightly better than those of AdMob but if that changes, theres no more argument that keeps madvertise in my apps.

How much?

Here are the numbers:

AdMob:

3D Invaders: $508.39

AL Voice Recorder: $895.47

AdMob Total: $1,403.86 (+$525.04)

 

madvertise:

3D Invaders: ~$220.97

AL Voice Recorder: ~$64.61

madvertise Total: ~$285.58 (-$465.64)

 

Market sales: ~$126.59 (+$49.96)

In-App purchases: ~$7.94 (-$6.90)

 

Total: ~$1,823.96 (+$102.47)

AdMob outperformed madvertise by far this month, which is pretty sad because I like them. I hope this will change soon, we will see.

What’s next?

I didn’t reach the goal I set in the last month again, so it again is $4,000 for this month. I think this is impossible but I hope I will get closer. I will integrate a new ad network in the next weeks, so if you have any great tipps, let me know.

 

Please feel free to share your own experiences and hints in the comments. Ask questions, share, do whatever you like.

Categories: Money & Income | Tags: , , , , , | 30 Comments

The new madvertise SDK: How to migrate

Three days ago, madvertise officially announced the availability of their new SDKs for Android and iOS.

What has changed?

This time, besides minor changes, rich media functionality, or to be more precise, the MRAID v. 1.0-standard, was implemented. For ads this means: They can be completely written in HTML 5 and they can access some extra functionality via JavaScript. With this extra functionality, for MRAID 1.0, ads are able to expand in size up to full screen. However, madvertise takes care that only ads requested in full screen mode will expand themself immediately. For smaller banner formats like MMA, ads will only expand on user interaction.

How to migrate?

First, install git.

Second, learn how to use git. Seriously.

Third: Clone the madvertise repository into your workspace or wherever you want it to be: git clone git://github.com/madvertise/madvertise-android-sdk.git. In case you already cloned the repository once, pull the new changes.

Now switch to the new mad_mraid10- branch: git checkout mad_mraid10

Import the SDK using new -> Android Project -> from existing source. In case you just pulled in step three, just select your madvertise SDK-project and hit F5. In the SDK Project you should now see a new class called MadvertiseMraidView.java. In the projects integrating the madvertise SDK as a source project, you should see some compile errors at the places where you implemented the MadvertiseCallbackListener. Add the unimplemented methods. They are:

public void onAdClicked()
public void onApplicationPause()
public void onApplicationResume()

onAdClicked() is, obviously, called when an ad is clicked by a user. In this method you can track ad clicks or reward your users by removing the ad for a couple of seconds. In case you want to do so I recommend something like
mMadView.setFetchingAdsEnabled(false);
mMadView.setVisibility(View.GONE);

setFetchingAdsEnabled(boolean isEnabled) allows you to stop fetching ads for a given MadvertiseView or to start it again.
onApplicationPause() is called when a rich media ad is expanded and the actual app content is not in the foreground anymore. The easyest construct here is to directly call onPause() from this method. onApplicataionResume() is the corresponding counterpart to onResume().

Lets look into the XML code, first into the attrs.xml. Here, add < attr name="placement_type" format="string" /> and < attr name="mraid" format="boolean" />. Obviously, you can include those values into your layout files as well:
mad:placement_type="interstitial"
mad:mraid="true"

Placement type declares how you plan to place your rich media ads. Interstitial is perfect when loading something and showing an ad in the meantime, for example full screen. Inline is more suitable for most of the other cases. With the mraid-attribute you declare whether you want rich media ads to be delivered to your app or not. In other words: If you want everything to stay the way it was, set mad:mraid="false". The default for this attribute is true, so if you want rich media functionality, you can leave your layout files just the way they were. With one exception: In case you already upgraded to SDK tools in revision 17, you should now replace the ‘xmlns:mad=...‘-namespace with xmlns:mad="http://schemas.android.com/apk/res-auto".

And that’s already it.

Conclusion

madvertise’s eCPMs and fillrates really sucked in the last months. However, the company doesn’t give up and promises higher costs per click for the new rich media ads. I hope they keep their word and that the rich media ads won’t be too annoying. Let me know what you think (and hope) in the comments.

Categories: Development, Development - Intermediate, Tutorial | Tags: , , , , | Leave a comment

App Store Optimization (ASO) (4/5): Ratings & Installs or: The Google Play Store Search Algorithm

Another part on App Store Optimization. Finally. By the way, if you are from Germany: There is an article on App Store Optimization in the current Android 360. Go and get it (if you want)!

If you are new to this series, I recommend starting from the first article on App Store Optimization. If you don’t want to read that much, this article can still give you valuable information on its own.

Parts of this series on App Store Optimization are:
1. Keywords
2. Description

3. Icons
4. Graphics
5. Videos

6. Ratings
7. Installs
8. Users

While the last articles covered Icons, Videos and Graphics, we will go more into the search algorithm of the Play Store (I still need to get used to this name), an area that probably fits most developers better. Because this article will cover big parts of how the the Play Store search algorithm (most likely) works, there will be a summarizing Play Store algorithm-part at the end.

6. Ratings

When it comes to two equal apps, the app with a better rating will receive a better ranking. When your app does not have any ratings yet, it will internally get a composite score representing the quality of the apps you published before. This means: Ratings are important. But how to get lots of positive ratings? Well, there are several methods, one of them is to buy them via certain dubious websites (I ‘ve never tried that), another way is to simply ask your users for ratings. This step is actually pretty simple but it can and most likely will improve your ratings a lot, provided that you are making it right:

  1. Ask your users using an AlertDialog. While a beautiful little button in your main menu may be nice, users have the tendency to ignore things that want something from them (like they do with banner ads) and keep them from doing what they actually want to do (explore your app). This is why a one- or n-time alert dialog will catch much more attention than a button that is just always there. Personally I prefer the one-time to the n-time version.
  2. Don’t ask them the first time they use your app. That’s pretty obvious. How should a user know how to rate your app when he didn’t even use it? Instead, wait until he used it five or six times or played through the third level or so. When a user uses an app a couple of times, this is a good indicator that he actually will give you a better ranking.
  3. Give them a chance to opt out. You shouldn’t force your users to rate your product but give them a chance to say ‘later’ or ‘don’t ask me again’. When a user decides not to rate a product but gets annoyed by repeated dialogs, there will come a time when he ranks it with very little stars.

 7. Installs

Installs are important. They are important for you, because many users equals many dollars. But they also are important for the Android Market Search Algorithm. To be more precise: The ratio of active installs to total installs, respectively the refund rate. This will have special weight when your app is published the first time and there are not enough comments to give your app a ranking and no other apps to give your app a composite score.

Since gaining installs and keeping active installs is very important, it’s important to have a well designed and tested app. Boosting user numbers by force can be a very expensive task, that’s why it’s even more important not to lose existing users. To increase the number of downloads of an app, the well known classic methods like writing blogs, creating viral content, paying for ad space or ASO can be applied.

The the Google Play Store Search Algorithm

The search algorithm of Google’s website is known to be a black box of which nobody except Google knows how it works exactly. Guess what: With the Play Store search algorithm, it’s exactly the same. Still, by try and error and a lot of observation, patterns can be recognized. Here’s what the Play Store search algorithm roughly looks like:

temporary relevance * t + keyword frequency  in the title * u + keyword frequency in the description * v + ratings * w + composite score * x + active installs in per cent * y + black magic * z

Temporary relevance here means the acceptance of the users over a small time period, or in other words the download rates in the last days and weeks. As you can see there is a little ‘black magic’ involved, this is a synonym for uncertain influences like the +1-button, the percentage of solved known bugs with every new update, the relevance of keywords used in the recent changes-description and all the other small and uncertain things.

After various observations, the following rough order can be assumed:

w >= t >= y > u > v > x

z, representing the weight of various factors, is ignored.

Now, when optimizing your app for the Play Store, you can try to improve your app’s environment based on this order, meaning for example: “Let’s put our main effort into a solid UX, a non-annoying dialog with a high conversion rate asking users to rate us high and a good description.”

 

Conclusion

You maybe noticed that the Play Store search algorithm changed a lot in the last 18 months. ASO is very dynamic. New changes need to be observed and classified as soon as possible, so it always stays exciting.

 

I’m open to your suggestion, criticism and questions. Please leave them in the comments.

Categories: ASO | Tags: , , , , , , , , , | 14 Comments