What version of Android can I customize?

I am going to write my first Android app. This is a fairly simple application that does not use any special functions, except the ability to schedule notifications and read / write image files to the local storage of the device. Reaching the widest audience is my top priority. If I am targeting Android 1.5, is the application guaranteed to work fine until ICS? Should I target Android 2.1, which seems to be the new base for regular phones?

Since the application is pretty simple, if I am targeting ICS, will it work on versions that have fully returned to 2.1? Perhaps this is a stupid question.

+6
source share
4 answers

At this point, I suggest you configure at least 1.6. Prior to this, several screens were not supported. Since there are currently hundreds or more devices with different screen sizes and densities, your application will not look good for everyone unless you use some of the things added in 1.6.

You can find the scheme in which the most active OS versions are: http://developer.android.com/resources/dashboard/platform-versions.html

based on the current chart, if you configure 2.1, then you will cover 97.7% of devices connected to the Android market in the last 2 weeks.

+6
source

There are many factors to consider:

1. Target audience

1.5 today does not matter much, and I do not recommend people to focus on it if it really is not necessary. App discovery today is 0.9% for these devices, according to current market statistics .

From an audience point of view, 1.5 doesn't matter.

1.6 is about 1.4% today, which is slightly larger, but still a trace. This argument alone is not important.

There is also a very important issue: your target audience. These are niche markets. For example, there are some 1.5 iDEN devices, and cupcake support becomes very important when working with these users.

You should not assume that since the device in the USA is updated from 2.1, it is located elsewhere. For example, Motorola has a terrible history of supporting devices in other countries. See, for example, the trend of #MOTOFAIL.

You should also consider the purpose of the country. People there, with less money, are more likely to have devices before Eclair today and smaller eclair / froyo devices. You must consider this and balance the needs of the API. But today I did not find it relevant. This is very important in poorer countries that are still flooded with 1.5 devices, but even that is changing (again, personal experience).

Finally, there is a net margin. In my personal experience, users with 1.5 and 1.6 are much, much less likely to pay and support the application. I have an application on the freemium model. I have 4 times (proportionally, obviously) more users in a free application than in paid applications.

2. API and ease of development

I do not recommend targeting 1.5 because of its layouts. If you work with it enough, you will see that there are flaws in the layout and affordable availability. The first foursquare app (just the example I looked at today in Google Code) has many lines that just take these issues into account. In my humble opinion, this is not worth it.

The good thing about 1.6 is that you get access to many very important libraries, mainly snippets and downloaders, which have been ported to 1.6 and will make your life a lot easier. You do not lose much by supporting all these legacy devices.

This is the main reason why people today install at least the API API.

Whenever you mix needs, you should read several API strategies .

And now minor issues. If your project is too large, you may wonder whether it is worth targeting the device without the app2sd function, which was introduced in froyo / 2.2 / api-8. However, I feel that it is not. And there are other minor issues that I cannot remember now.

However, 1.6 is not a holy grail. If you aim at 1.6, you will find minor troubles. To say a very small example, I don't think that onKeyLongPress() is available on devices up to 2.0. Same thing with Service.onStartCommand and many Service flags (api 5 and above).

For example, I like to rely on START_FLAG_REDELIVERY or START_STICKY . Thus, although you can use Loader in 1.6, I believe that I need other functions to complement the drawbacks of 1.6. And most of these features are not available for 1.6 AFAIK.

And this is just one of the little problems. They are scattered, which makes their implementation difficult.

Better APIs give you less time to market and better performance.

3. Development of strategies

Personally, I would do the following (I'm actually doing it right now): for a lower level device (1.6), and whenever you feel the need to implement something that is not there, change the target to a higher API so that get your "feeling". This helps when you already know what to implement.

If you do not know what to implement (by code, of course), specify the highest API (usually 2.3) so that you can view the code completion functions. I know this sounds a bit like a β€œtrial error,” but I don't know if there is a more practical way to find out.

4. Crushing

Since I know that this will generate f-word comments, keep in mind that this, at least in my opinion, is not much about fragmentation, but much more about learning the API and knowing your purpose and market. Fragmentation is secondary to this discussion, so I think we better avoid this heated debate.

Technically, you can see the differences in the API Difference .

Yes, I think a good review.

Appendix: what I did today (edited)

As a rule, all other things being equal and for the general application, I would use the API 7 / eclair. These are still 97% of the devices that are currently sold on the market, but at the same time provide opportunities for rich applications and ease of development, which makes you more productive with less time to market, while ensuring some profitability.

+9
source

FYI, versions 2.2 and 2.3 currently make up more than 90% of Android devices.

If I am targeting Android 1.5, is the application guaranteed to work fine right up to ICS?

Yes

Should I configure Android 2.1, which, apparently, is the new base for regular phones?

I think all is well.

Since the application is quite simple, if I focus on ICS, will it work on versions starting from 2.1?

Good.

In my opinion, don’t worry about this and just start developing your first application with 2.2, as it will cover 90% of current and future devices. I do not think that you will have problems with the target version. This is one of the easiest parts of Android development.

+3
source

Many Android features are passed on to earlier versions of Google (e.g. fragments )

If you use only simple things (which have been around for a while, then I would suggest that you choose the lowest level - v1.6) when maintaining multiple screen sizes started.

+1
source

Source: https://habr.com/ru/post/902804/


All Articles