Android software update features

Implement In-app Update In Android

Make sure every user of your app is on the new version.

Apr 6, 2020 · 8 min read

In this article, we will learn about the In-app update feature in Android what is all about In-app update, what are the benefits of using the In-app update in your android application. Recently I’ve been working on a product in which I need to Implement an In-app update Why we need to Implement this?.

As a Developer we always want our users to have the updated version of their application but there are a lot of people who actually turned off their auto update from google play store and he/she doesn’t know about any update available or not.

To overcome the problem Google Introduced this feature called In-app update from this feature you can easily prompt the user to update the application and with the user permission you can update the application also while updating the app user can be able to interact with the application. Now the user doesn’t need to go to google play store to check there is any update available or not.

What is In-App Update:

An In-app update was Introduced as a part of the Play Core Library, which actually allows you to prompts the user to update the application when there is any update available on the Google Play Store.

There are two modes of an In-app update.

  • Flexible Update
  • Immediate Update

Flexible Update:

In Flexible update, the dialog will appear and after the update, the user can interact with the application.

This mode is recommended to use when there is no major change In your application like some features that don’t affect the core functionality of your application.

The update of the application is downloading in the background in the flexible update and after the completion of the downloading, the user will see the dialog in which the user needs to restart the application. The dialog will not automatically show, we need to check and show to the user and we will learn how later.

Benefits:

The major benefit of the flexible update is the user can interact with the application.

Источник

In-App Updates: ускоряем процесс обновления приложения на Android

Среди многообразия инструментов, анонсированных на Android Dev Summit, особое внимание хочется уделить механизму обновления приложения In-App Updates (IAUs), который помогает разработчикам ускорить добавление новых фич, баг-фиксов и улучшений производительности. Поскольку эта функциональность была опубликована после Google I/O 2019, в этой статье я подробно расскажу об IAUs, опишу рекомендованные схемы реализации и приведу некоторые примеры кода. Также я расскажу о нашем опыте интеграции IAUs в Pandao, приложение для заказа товаров из Китая.

Новый API позволяет разработчикам инициировать обновление приложения до последней доступной в Google Play версии. Таким образом IAUs дополняет уже существующий механизм автоматического обновления Google Play. IAUs содержит несколько схем реализации, которые принципиально различаются с точки зрения взаимодействия с пользователем.

    Flexible Flow предлагает пользователям скачать обновление в фоновом режиме и установить в удобное для пользователя время. Он предназначен для случаев, когда пользователи всё ещё могут использовать старую версию, но уже доступна новая.



Immediate Flow требует от пользователей скачать и установить обновление, прежде чем продолжить использование приложения. Он предназначен для случаев, когда для разработчиков критически важно обновить приложение.


Поскольку второй вариант не так важен и меньше подходит для приложения Pandao, разберём подробнее сценарий Flexible Flow.

Интеграция IAUs Flexible Flow

Варианты использования

Процесс обновления с помощью IAUs состоит из нескольких шагов.

  1. Приложение с помощью библиотеки Play Core, которая проверяет в Google Play, есть ли доступные обновления.
  2. Если они есть, то приложение просит Google Play показать диалог IAUs. Google Play показывает пользователю диалог с предложением обновиться.
  3. Если пользователь соглашается, Google Play в фоновом режиме скачивает обновление, показывая пользователю в статус-баре прогресс скачивания.
  4. Если скачивание завершилось, когда приложение работает в фоновом режиме, Google Play автоматически завершает установку. Если же приложение в этот момент активно, то для таких случаев нужно определять собственную логику завершения установки. Рассмотрим следующие сценарии.
    1. Приложение запускает процесс установки, показав пользователю диалог Google Play с индикатором прогресса. После завершения установки запускается обновленная версия приложения. В этом случае рекомендуется отобразить дополнительный диалог, который позволит пользователю подтвердить, что он готов сейчас перезапустить приложение. Это рекомендуемая схема реализации.
    2. Приложение ждёт, пока оно окажется в фоновом режиме, и после этого завершает обновление. С одной стороны, это менее навязчивое поведение с точки зрения UX, так как взаимодействие пользователя с приложением не прерывается. Но с другой — оно требует от разработчика реализовать логику для определения того, находится ли приложение в фоновом режиме.
Читайте также:  Как изменить пароль вай фая через андроид

Если установка скачанного обновления не была завершена, то Google Play может завершить установку в фоновом режиме. Данный вариант лучше не использовать явно, потому что он не гарантирует установки обновления.

Основные требования к тестированию

Чтобы вручную выполнить весь процесс обновления на тестовом устройстве, нужно иметь как минимум две версии приложения с разными номерами сборок: исходная и целевая.

  • Исходная версия с более высоким номером должна быть опубликована в Google Play, она будет идентифицирована Google Play как доступное обновление. Целевая версия с более низким номером сборки и интегрированным IAUs должна быть установлена на устройстве, её мы будем обновлять. Суть в том, что когда приложение попросит Google Play проверить наличие обновления, он сравнит номера сборок у установленной и доступной версии. Так что IAUs будет запущено только в том случае, если номер сборки в Google Play выше, чем у текущей версии на устройстве.
  • Исходная и целевая версии должны иметь одинаковые имена пакета и должны быть подписаны одинаковым релизным сертификатом.
  • Android 5.0 (API level 21) или выше.
  • Библиотека Play Core 1.5.0 или выше.

Пример кода

Здесь мы рассмотрим пример кода для использования IAUs Flexible Flow, который также можно найти в официальной документации. Для начала необходимо добавить библиотеку Play Core в build.gradle файл на уровне модуля.

Затем создадим экземпляр AppUpdateManager и добавим функцию обратного вызова к AppUpdateInfo , в которой будет возвращаться информация о доступности обновления, объект для запуска обновления (если оно доступно) и текущий прогресс скачивания, если оно уже началось.

Чтобы показать диалог для запроса обновления из Google Play, необходимо передать полученный объект AppUpdateInfo в метод startIntentSenderForResult .

Для отслеживания состояния обновления можно добавить в менеджер IAUs слушатель событий InstallStateUpdatedListener .

Как только обновление будет скачано (статус DOWNLOADED ), нужно перезапустить приложение, чтобы завершить обновление. Перезапуск можно инициировать с помощью вызова appUpdateManager.completeUpdate() , но перед этим рекомендуется показать диалоговое окно, чтобы пользователь явно подтвердил свою готовность к перезапуску приложения.

Ошибка «Update is Not Available»

Во-первых, перепроверьте соответствие требованиям, перечисленным в разделе «Basic Implementation Requirements». Если вы все выполнили, однако обновление согласно вызову onSuccess , всё же недоступно, то проблема может быть в кэшировании. Вполне вероятно, что приложение Google Play не знает о доступном обновлении из-за внутреннего механизма кэширования. Чтобы избежать этого при ручном тестировании, вы можете принудительно сбросить кэш, зайдя на страницу «Мои приложения и игры» в Google Play. Или можете просто очистить кэш в настройках приложения Google Play. Обратите внимание, что эта проблема возникает только в ходе тестирования, она не должна влиять на конечных пользователей, поскольку у них кэш всё равно обновляется ежедневно.

IAUs Flexible Flow в приложении Pandao

Мы участвовали в программе раннего доступа и интегрировали IAUs Flexible Flow (рекомендованная реализация) в приложение Pandao — платформу, на которой производители и вендоры могут торговать китайскими товарами. Диалог IAUs отображался на главном экране, так что с ним могло взаимодействовать максимальное количество пользователей. Изначально мы хотели показывать диалог не чаще раза в день, чтобы не отвлекать людей от взаимодействия с приложением.

Поскольку A/B-тестирование играет ключевую роль в жизненном цикле любой новой фичи, мы решили оценить эффект от IAUs в нашем приложении. Мы случайным образом разделили пользователей на две непересекающиеся группы. Первая была контрольной, без использования IAUs, а вторая группа была тестовой, этим пользователям мы показывали диалог IAUs.


A/B-тест IAUs Flexible Flow в приложении Pandao.

В течение последних нескольких релизов мы измерили долю активных пользователей каждой версии приложения. Оказалось, что среди активных пользователей с последней доступной на тот момент версией основную часть составляли участники из группы B, то есть с функцией IAU. Фиолетовая линия на графике показывает, что в первые дни после публикации версии 1.29.1 количество активных пользователей с IAUs превысило количество пользователей без этой функции. Поэтому можно утверждать, что пользователи с IAUs быстрее обновляют приложение.


Диалог IAUs Flexible Flow в приложении Pandao.

Согласно нашим данным (см. график выше), пользователи больше всего кликают на кнопку подтверждения в диалоге IAUs в первые дни после релиза, а затем конверсия постоянно снижается вплоть до публикации следующей версии приложения. То же самое наблюдается с кнопкой установки в диалоговом окне, которая инициирует установку скачанного обновления. Следовательно, можно сказать, что среднее значение конверсии в обоих случаях прямо пропорционально частоте релизов. В Pandao средняя конверсия в течение одного месяца достигает 35 % для клика на кнопку подтверждения и 7 % для клика на кнопку установки.

Мы предполагаем, что уменьшение доли подтверждений с течением времени — лишь проблема пользовательского опыта, потому что люди, которым интересна новая версия, будут обновляться довольно быстро, а те, кто не интересуются обновлением, так и не станут интересоваться. Исходя из этого предположения, мы решили не беспокоить тех, кому не интересно обновление, и не спрашивать их каждый день. Хорошей практикой будет использование другой логики запросов, которая основывается на «устаревании», то есть чтобы не беспокоить пользователей, мы оцениваем, насколько старые версии стоят у них и как часто мы уже предлагали им обновиться.

Читайте также:  Zte axon 9 pro андроид 10

В целом IAUs продемонстрировала хорошие результаты в ходе A/B-тестирования, так что мы раскатили IAUs для всех пользователей.

Источник

In-app updates

When your users keep your app up to date on their devices, they can try new features, as well as benefit from performance improvements and bug fixes. Although some users enable background updates when their device is connected to an unmetered connection, other users might need to be reminded to install updates. In-app updates is a Play Core library feature that prompts active users to update your app.

The in-app updates feature is supported on devices running Android 5.0 (API level 21) or higher, and requires your app to use Play Core library version 1.5.0 or higher. Additionally, in-app updates are only supported for Android mobile devices, Android tablets, and Chrome OS devices.

Update flows

Your app can use the Play Core library to support the following UX flows for in-app updates:

Flexible updates

Flexible updates provide background download and installation with graceful state monitoring. This UX flow is appropriate when it’s acceptable for the user to use the app while downloading the update. For example, you might want to encourage users to try a new feature that’s not critical to the core functionality of your app.

Figure 1. An example of a flexible update flow.

Immediate updates

Immediate updates are fullscreen UX flows that require the user to update and restart the app in order to continue using it. This UX flow is best for cases where an update is critical to the core functionality of your app. After a user accepts an immediate update, Google Play handles the update installation and app restart.

Figure 2. An example of an immediate update flow.

Support in-app updates in your app

Learn how to support in-app updates in your app, depending on your development environment:

Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.

Источник

How Do I Block Android from Installing System Updates?

I’ve said it before, and I’ll keep saying it: It’s important to keep your devices updated. Though even I’ll admit there are few exceptions to this rule. If Microsoft just launched a huge Windows update, you might want to give it a few days just in case something goes catastrophically wrong . If you have a super-old smartphone and are being asked to update to the latest version of its operating system, consider doing some research to make sure it’s not going to cripple your device’s performance.

But to hold off on all device updates because you’re concerned about what they might do to your hardware? I’m not sure I’m a fan of that idea, but that’s exactly what Lifehacker reader Valerie sent to me for this week’s Tech 911 advice column:

“I have a Samsung galaxy which I have had for less than 1 year.

I despise all the updates that are automatically performed on the phone.

My questions. 1. is there a way to reverse the updates already performed and 2. Is there a way to stop automatic future updates from being performed?

I called Verizon who got me on the phone with Samsung. The Samsung rep I spoke to was rather condescending and told me there was no way to stop the updates. He told me to ‘Try it, you’ll like it.’

In the advanced world of technology. I’m thinking if they can put updates on the phone there must be a way of reversing or stopping them.”

I hear where you’re coming from. It can be jarring to receive an update to your device and feel like you’ve been cast into unfamiliar territory, especially if your device’s manufacturer made some sweeping changes to its operating system. Whenever Apple kicks off a new version of iOS each year—I use an iPhone as my primary carry device—I always feel like I have to do a little scrambling to understand everything that’s new: fun features, subtle changes, tweaked gestures, et cetera.

Does that stop me from upgrading to the new iOS? Never. It’s just a process I’ve come to accept, a learning curve that will vary in length for everyone depending on how much you use your device and how quick you are to catch on to new concepts and workflows. There’s no shame in feeling overwhelmed, or even downright hostile to change. It’s human.

Apple AirPods 3

A whole new look

I haven’t addressed your actual question yet, because I want to emphasize one more fact: Device updates aren’t just about new features. They’re also about fixing bugs in previously broken setups or, even more important, patching up vulnerabilities to make you and your data more secure. For that reason, above everything else, I would caution you to keep on receiving your smartphone’s updates—no matter the cost.

Читайте также:  Начиная работу с андроид с чего начать
How to Enable All the New Android Q Beta 3 Features

Android Q Beta 3 is now available for public consumption as of yesterday’s big kickoff to Google…

For you, specifically, consider what’s coming down the road with Android Q . As Florence Ion wrote for us back in May:

“Google claimed that nearly 50 features are coming to Android Q related to security and privacy. We won’t know the extent of those changes until Android Q goes live to everyone. However, Google hinted at some of the options you’ll be able to access in the Android settings panel, including a new front-and-center Privacy section, with a bevy of settings for controlling which apps and services have access to your data. There will also be a new Permissions option that will let you choose how and when data and other elements are shared with Google and other third-party apps.”

In addition to that, Android Q is going to make it a lot easier for manufacturers to deploy over-the-air updates to fix any issues they find with 14 different (critical) modules found within the Android operating system. You won’t even have to restart your device to receive them; they’ll just update, and that’ll be it. However, you’ll need to have Android Q to take advantage of this feature. Google isn’t planning to roll it out to older versions of the OS.

It’s Time to Try Android Q Beta 5

If you’re curious about what the Android Q experience will be like, but have been holding off on…

Blocking Android system updates

Hopefully I’ve convinced you about the importance of updating your Android device. If not, I can at least answer your question—as much as it pains me.

To block Android updates, I’d recommend exploring three options. First, pull up your Software Update screen—via Settings > Software Update—to see if there’s any kind of setting you can uncheck regarding the automatic download of software updates. (I don’t have a Galaxy device sitting in front of me, or else I’d screenshot this for you.)

You’ll probably need a little more than that to make sure that your device isn’t downloading and installing updates without your express permission. There’s another setting you should be able to toggle to disable automatic system updates, but it’s a little buried. Pull up Settings again and scroll down until you see the “About phone” section. Tap on that. Then, tap on the “Software Information” section, and scroll down until you see “Build Number.” Start tapping on that section until your device says that you’ve enabled “Developer mode.”

How Do I Move Messages From an Old Android Phone to a New One?

Welcome back to Lifehacker’s weekly tech-advice column, Tech 911. As always, I want you to email me

Then, head back to your primary Settings screen and scroll down. You should see a new “Developer options” section near “About phone.” Tap on it, and then look for the “Automatic system updates” option. Make sure it’s not enabled.

That should prevent your phone from receiving automatic updates. But to be super-super sure, you can also purchase and sideload the Package Disabler Pro app. You’ll then use this to disable your device’s Software Update feature, which will keep it on the current version of your operating system forevermore.

As for the part of your question about going back to an older version of your smartphone’s OS, it’s certainly possible, but it requires a good amount of effort and technical know-how that I wouldn’t recommend for an average user. That includes downgrading your device’s bootloader, if that’s even possible, and installing an older version of your device’s OS (if your manufacturer even makes those available / you can find one). As Android Central’s Jerry Hildenbrand puts it:

“Sometimes the hacks used to flash software to your model of Android are simple and not that hard to do correctly. But that’s not always the case and you’ll usually see a handful of people explaining how they ruined their phone when things took a turn for the worse.

I’m not trying to talk you out of it, but you need to know that the five minutes it takes to flash your phone back to an older version could have hours and hours of reading as a prerequisite.”

My advice? Master what you have now and disable device updates going forward —if you truly must. For the sake of your security, I still wouldn’t go this route, but I understand if you want to freeze your device’s features in time.

Источник

Оцените статью