天道酬勤,学无止境

android-instant-apps

Android InstantApp: Foreground service

问题 无法在 InstantApp 功能模块中使用前台服务。 低于运行时安全异常。 java.lang.RuntimeException:无法启动活动 ComponentInfo{ 。 .XYZActivity}:java.lang.SecurityException:方法类 android.app.ActivityManagerProxy.getServices 不适用于即时应用 Android文件说, 受限功能:在用户不知情的情况下在设备上运行。 前台服务可用。 即时应用程序只能通过支持应用程序链接的活动启动,因此服务、内容提供者或广播接收器将无法启动您的应用程序。 代码: // Starting service getAppContext().startService(new Intent(getAppContext(), FirebaseAuthService.class)); // Foreground service class public class FirebaseAuthService extends Service { private static final String TAG = "FirebaseAuthService"; private boolean isRunning = false; private String mUserId

2022-05-02 20:01:02    分类:技术分享    android   service   android-instant-apps   foreground-service

Is it possible to use published instant apps(BuzzFeed, Wish, etc) on the emulator?

问题 我按照 Google 的教程在模拟器上运行了一个 hello world 即时应用程序。 一切正常,我收到对话框,询问是否允许启用即时应用程序,然后单击“我在”。 之后,我还可以看到在设置 > Google > 即时应用中启用了即时应用。 但是,当我打开浏览器,运行搜索并点击已经发布了即时应用程序的网站的链接时,例如 BuzzFeed、NY Times Crossword 和 Wish,它们只会打开常规网页。 我发现这些应用正在观看关于即时应用的 Google IO 16 和 17 演示文稿。 我什至尝试了本主题演讲中的链接 https://www.buzzfeed.com/tasty,但无济于事。 我怀疑这是因为当前支持的模拟器没有内置 Play Store。 根据此列表,我也在一个尚不支持即时应用程序的国家/地区(巴西)。 但我不确定这是否会影响模拟器。 有谁知道这些是否确实是我无法查看已在 Play Store 上发布的即时应用程序的原因? 回答1 由于巴西目前不在支持 Android Instant Apps 的国家/地区列表中,因此该功能在真实设备上已关闭,但模拟器仍可用于 Instant Apps 开发和测试。 BuzzFeed 等生产级应用程序只能在以下列表中的国家/地区通过即时应用程序启动:https://support.google.com

2022-05-02 12:30:16    分类:技术分享    android   android-emulator   android-instant-apps

How to save picture in instant app

how to save picture in instant app <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="***"> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/> <application android:allowBackup="true" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"/> EasyPermissions.requestPermissions(this, "11", REQUEST_STORAGE_PERMISSION, Manifest.permission.WRITE_EXTERNAL

2022-03-25 08:02:42    分类:问答    android   android-instant-apps

manifest merging error, throws exception

I'm trying to convert my app to Instant app. I create the base module but my manifest giving some error. I tried a lot. Is this is a plugin error or any third party library issue which I am using? I am attaching here my Manifest file of base module and app module. Please help me to resolve this issue. ManifestFileOFBaseModule: `<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="blast.com.lovethisplace"> <uses-feature android:glEsVersion="0x00020000" android:required="true" /> <uses

2022-03-25 02:52:27    分类:问答    android   exception-handling   android-manifest   android-instant-apps

INVALID_ARGUMENT:应用程序凭据标头无效。 请修复客户端以传递有效的应用程序凭据标头(INVALID_ARGUMENT: Application credential header not valid. Please fix the client to pass a valid application credential header)

问题 尝试运行简单的 Android Instant App 时,我在控制台中收到此错误,并且该应用程序无法打开。 这个错误是什么意思,我如何传递一个有效的凭证头? 回答1

2022-03-21 09:25:17    分类:技术分享    android   android-instant-apps

Is it possible to use published instant apps(BuzzFeed, Wish, etc) on the emulator?

I've run a hello world instant app on an emulator following this Google's tutorial. Everything worked well, I got the dialog asking for permission to enable instant apps and clicked 'I'm in'. After that, I could also see that instant apps were enabled in Settings > Google > Instant Apps. But when I open my browser, run a search and click on links from websites that already have published instant apps, such as BuzzFeed, NY Times Crossword and Wish, they just open the regular web page. I found out those apps watching Google IO 16 and 17 presentations about instant apps. I even tried the link

2022-03-20 14:06:18    分类:问答    android   android-emulator   android-instant-apps

Build error with Android Studio 3.0 Canary 4

I am currently in the process of developing an Instant app, for which I have restructured my monolithic app into feature modules. Everything was up and running till Android Studio canary 3, but after an update to Android Studio Canary 4 my project fails to build with the following error: A problem was found with the configuration of task ':minimoBase:dataBindingExportBuildInfoDebugAndroidTest'. > Directory '/Users/nayak.vishal/projectData/minimo_instant_app_project/putica-client-android- native/minimoBase/build/intermediates/data-binding-info/androidTest/debug' specified for property

2022-03-16 03:27:18    分类:问答    android   android-studio   gradle   android-instant-apps

Android InstantApp: Foreground service

Unable to use foreground service inside InstantApp feature module. Getting below runtime security exception. java.lang.RuntimeException: Unable to start activity ComponentInfo{..XYZActivity}: java.lang.SecurityException: Method class android.app.ActivityManagerProxy.getServices not available to instant apps Android document says, Restricted features: Run on the device without users being aware. Foreground services are available. Instant apps can only be started through activities that support App Links, so services, content providers or broadcast receivers won't be able to start your app. Code

2022-03-13 07:34:44    分类:问答    android   service   android-instant-apps   foreground-service

INVALID_ARGUMENT: Application credential header not valid. Please fix the client to pass a valid application credential header

When attempting to run a simple Android Instant App, I receive this error in the console and the app does not open. What does this error mean and how do I pass in a valid credential header?

2022-03-11 00:47:13    分类:问答    android   android-instant-apps