草庐IT

ddd-service

全部标签

Android L Youtube API - IllegalArgumentException : Service Intent must be explicit

我知道在L上我只能绑定(bind)声明为显式的服务。在我的应用程序中,我目前正在使用YoutubeAPI,当在带有L的设备上运行时,我总是会收到此错误java.lang.IllegalArgumentException:ServiceIntentmustbeexplicit:Intent{act=com.google.android.youtube.api.service.START}如何解决这个问题,让YoutubeAPI也可以在L上运行? 最佳答案 有一个新版本的YoutubeAPI(1.2.1)可以解决这个问题。可以从here

android - 线程运行时在 Service 中调用 stopSelf()

假设我的Service的onStart()处理程序中有代码来启动一个线程来做一些事情,然后调用stopSelf()。stopSelf()在线程完成之前被调用。究竟会发生什么?我自己对此进行了测试,并且我的线程会继续执行直到完成。Android是否听到stopSelf()调用,但将其推迟到线程完成?@OverridepublicvoidonStart(Intentintent,intstartid){newThread(newRunnable(){publicvoidrun(){//TODOsomelongrunningoperation}}).start();stopSelf();}

android - 在哪里可以找到有关 Android 的 "service call"shell 命令的信息?

使用adbshell或设备上的终端模拟器,输入此将清除所有通知(需要su)servicecallnotification1这将发送一条短信(不需要su)servicecallisms5s16"PhoneNumber"i320i320s16"BodyText"在哪里可以了解有关服务调用的更多信息?我找到了thisquestion并欣赏答案对所有含义的分割。但是我在哪里可以找到关于notification2可能试图调用的方法的信息?运行servicecall不完整并打印出这个用法:Usage:service[-h|-?]servicelistservicecheckSERVICEservi

android - 项目树中的 google-services.json 位置

我正在关注本手册,但不确定应该将文件google-services.json准确复制到哪里?有许多文件夹包含一个app文件夹,我正在尝试为androidwear开发它。任何指南都会非常棒。到目前为止,我把它放在这里:链接到tutorial 最佳答案 正在为Android应用程序配置Firebase,它对这些提供了很好的描述。正如公认的答案所说,我应该放在app文件夹中。添加图像以更好地了解放置位置和所需配置。 关于android-项目树中的google-services.json位置,我

Android:将参数从Activity传递给Service

我通过这种方式绑定(bind)到服务:Activity类:ListenLocationServicemService;@OverridepublicvoidonCreate(BundlesavedInstanceState){...Intentintent=newIntent(this,ListenLocationService.class);intent.putExtra("From","Main");bindService(intent,mConnection,Context.BIND_AUTO_CREATE);...}privateServiceConnectionmConnec

android - Gradle 错误 : Unexpected inputs: android. gms:play-services

在运行时显示错误Gradle中的错误:错误:任务':app:transformClassesWithInstantRunForDebug'执行失败。Unexpectedinputs:ImmutableJarInput{name=com.google.android.gms:play-services-basement:9.0.0,file=/home/nawaf/AndroidStudioProjects/YugiohDeckBuilder/app/build/intermediates/transforms/profilers-transform/debug/43.jar,conte

android - 更新后 - 错误 :Failed to find: com. google.android.gms :play-services:5. 2.8

Gradle项目同步失败。更新androidSDK后出现此错误:Error:Failedtofind:com.google.android.gms:play-services:5.2.8我已检查更新的sdk位置是否已被AndroidStudio使用我已经安装了GoogleRepository并且AndroidSupportRepository也是最新的。还有一个ANDROID_HOME局部变量指向我实际使用的sdk 最佳答案 尝试使用com.google.android.gms:play-services:5.2.08而不是5.2.

android - Gradle 构建工具找不到 play-services-tasks.aar?为什么?

今天突然,我在AndroidStudio中运行我的应用时遇到了错误。它是:Error:Couldnotfindplay-services-tasks.aar(com.google.android.gms:play-services-tasks:15.0.1).Searchedinthefollowinglocations:https://jcenter.bintray.com/com/google/android/gms/play-services-tasks/15.0.1/play-services-tasks-15.0.1.aar我没有更改gradle文件中的任何内容,但它突然出现

android - 找不到 com.google.android.gms :play-services:7. 3.0

我有这个来自AndroidStudiogradle的日志:Error:Aproblemoccurredconfiguringproject':ParseStarterProject'.>Couldnotresolvealldependenciesforconfiguration':ParseStarterProject:_debugCompile'.>Couldnotfindcom.google.android.gms:play-services:7.5.0.Searchedinthefollowinglocations:https://repo1.maven.org/maven2/c

android - 无法添加 gms 播放服务 9.0.1,google-services 插件想要 9.0.0

我的顶级build.gradle中有这个:buildscript{repositories{jcenter()}dependencies{classpath'com.google.gms:google-services:3.0.0'}}allprojects{repositories{jcenter()}}在我的应用级gradle中:applyplugin:'com.google.gms.google-services'dependencies{compile'com.google.android.gms:play-services-ads:9.0.1'}同步gradle时出现此错误: