我是 Android 开发的新手(但不是一般的开发)。在 iOS 中,文档清楚地说明了特定 API 可用的 iOS SDK 版本。
在 Android 中我很困惑。
我使用的是 android-10 平台,我的 minimumSDK 和 targetSDK 都是 10。我使用的是 Google Play Services 7.5.0。
我知道我在 android-10 中使用的 api 仍然适用于更高版本的 android(4.4.4、5.0 等)。但是我怎么知道 Google Play Services 7.5.0 可以工作,Lollipop 的所有操作系统版本都可以恢复到 2.3.3?我没有足够的设备进行测试。
在我指定的 build.grade 文件中:
dependencies{
....
compile 'com.google.android.gms:play-services:+'
compile 'com.google.android.gms:play-services-ads:7.5.0'
....
}
我不完全理解这些行的意思(我是从一些教程中学习的)。我如何知道它们将与哪些 Android 操作系统版本兼容? Build.gradle 中的这些行是否正常?
最佳答案
compile 'com.google.android.gms:play-services:+'
当您使用加号而不是指定版本时,gradle 将自动下载并使用它找到的库的最新版本。不建议这样做,因为当 gradle 开始使用新版本时,库版本之间的潜在更改可能会破坏您的代码。最好自己指定。例如
compile 'com.google.android.gms:play-services:7.8.0'
这会导入整个 playservices 库,因此您实际上不需要第二个 play-services-ads:7.5.0行作为其全部准备好的导入。
此外,由于 playservices 库太大,使用整个库并不是一个好主意。最好只使用您的应用程序所需的模块。每个部分都可以用 compile '<module>' 指定.它将节省您的空间和构建时间。
Google+ com.google.android.gms:play-services-plus:7.5.0
Google Account Login com.google.android.gms:play-services-identity:7.5.0
Google Actions, Base Client Library com.google.android.gms:play-services-base:7.5.0
Google App Indexing com.google.android.gms:play-services-appindexing:7.5.0
Google App Invites com.google.android.gms:play-services-appinvite:7.5.0
Google Analytics com.google.android.gms:play-services-analytics:7.5.0
Google Cast com.google.android.gms:play-services-cast:7.5.0
Google Cloud Messaging com.google.android.gms:play-services-gcm:7.5.0
Google Drive com.google.android.gms:play-services-drive:7.5.0
Google Fit com.google.android.gms:play-services-fitness:7.5.0
Google Location, Activity Recognition, and Places com.google.android.gms:play-services-location:7.5.0
Google Maps com.google.android.gms:play-services-maps:7.5.0
Google Mobile Ads com.google.android.gms:play-services-ads:7.5.0
Google Nearby com.google.android.gms:play-services-nearby:7.5.0
Google Panorama Viewer com.google.android.gms:play-services-panorama:7.5.0
Google Play Game services com.google.android.gms:play-services-games:7.5.0
SafetyNet com.google.android.gms:play-services-safetynet:7.5.0
Google Wallet com.google.android.gms:play-services-wallet:7.5.0
Android Wear com.google.android.gms:play-services-wearable:7.5.0
最后要了解什么级别的 playservices 与查看开发者指南兼容
Overview of Google Play Services
上面写着
The Google Play services APK is delivered through the Google Play Store, so updates to the services are not dependent on carrier or OEM system image updates. In general, devices running Android 2.3 (API level 9) or later and have the Google Play services app installed receive updates within a few days. This allows you to use the newest APIs in Google Play services and reach most of the devices in the Android ecosystem. Devices older than Android 2.3 or devices without the Google Play services app are not supported.
关于android - 哪些 Android 平台/API 与 Google Play 服务版本兼容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32086428/
我正在尝试使用ruby和Savon来使用网络服务。测试服务为http://www.webservicex.net/WS/WSDetails.aspx?WSID=9&CATID=2require'rubygems'require'savon'client=Savon::Client.new"http://www.webservicex.net/stockquote.asmx?WSDL"client.get_quotedo|soap|soap.body={:symbol=>"AAPL"}end返回SOAP异常。检查soap信封,在我看来soap请求没有正确的命名空间。任何人都可以建议我
我想安装一个带有一些身份验证的私有(private)Rubygem服务器。我希望能够使用公共(public)Ubuntu服务器托管内部gem。我读到了http://docs.rubygems.org/read/chapter/18.但是那个没有身份验证-如我所见。然后我读到了https://github.com/cwninja/geminabox.但是当我使用基本身份验证(他们在他们的Wiki中有)时,它会提示从我的服务器获取源。所以。如何制作带有身份验证的私有(private)Rubygem服务器?这是不可能的吗?谢谢。编辑:Geminabox问题。我尝试“捆绑”以安装新的gem..
我在我的Rails项目中使用Pow和powifygem。现在我尝试升级我的ruby版本(从1.9.3到2.0.0,我使用RVM)当我切换ruby版本、安装所有gem依赖项时,我通过运行railss并访问localhost:3000确保该应用程序正常运行以前,我通过使用pow访问http://my_app.dev来浏览我的应用程序。升级后,由于错误Bundler::RubyVersionMismatch:YourRubyversionis1.9.3,butyourGemfilespecified2.0.0,此url不起作用我尝试过的:重新创建pow应用程序重启pow服务器更新战俘
最近,当我启动我的Rails服务器时,我收到了一长串警告。虽然它不影响我的应用程序,但我想知道如何解决这些警告。我的估计是imagemagick以某种方式被调用了两次?当我在警告前后检查我的git日志时。我想知道如何解决这个问题。-bcrypt-ruby(3.1.2)-better_errors(1.0.1)+bcrypt(3.1.7)+bcrypt-ruby(3.1.5)-bcrypt(>=3.1.3)+better_errors(1.1.0)bcrypt和imagemagick有关系吗?/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ru
我正在尝试修改当前依赖于定义为activeresource的gem:s.add_dependency"activeresource","~>3.0"为了让gem与Rails4一起工作,我需要扩展依赖关系以与activeresource的版本3或4一起工作。我不想简单地添加以下内容,因为它可能会在以后引起问题:s.add_dependency"activeresource",">=3.0"有没有办法指定可接受版本的列表?~>3.0还是~>4.0? 最佳答案 根据thedocumentation,如果你想要3到4之间的所有版本,你可以这
在Rails4.0.2中,我使用s3_direct_upload和aws-sdkgems直接为s3存储桶上传文件。在开发环境中它工作正常,但在生产环境中它会抛出如下错误,ActionView::Template::Error(noimplicitconversionofnilintoString)在View中,create_cv_url,:id=>"s3_uploader",:key=>"cv_uploads/{unique_id}/${filename}",:key_starts_with=>"cv_uploads/",:callback_param=>"cv[direct_uplo
我有用于控制用户任务的Rails5API项目,我有以下错误,但并非总是针对相同的Controller和路由。ActionController::RoutingError:uninitializedconstantApi::V1::ApiController我向您描述了一些我的项目,以更详细地解释错误。应用结构路线scopemodule:'api'donamespace:v1do#=>Loginroutesscopemodule:'login'domatch'login',to:'sessions#login',as:'login',via::postend#=>Teamroutessc
如果我使用ruby版本2.5.1和Rails版本2.3.18会怎样?我有基于rails2.3.18和ruby1.9.2p320构建的rails应用程序,我只想升级ruby的版本,而不是rails,这可能吗?我必须面对哪些挑战? 最佳答案 GitHub维护apublicfork它有针对旧Rails版本的分支,有各种变化,它们一直在运行。有一段时间,他们在较新的Ruby版本上运行较旧的Rails版本,而不是最初支持的版本,因此您可能会发现一些关于需要向后移植的有用提示。不过,他们现在已经有几年没有使用2.3了,所以充其量只能让更
我安装了ruby版本管理器,并将RVM安装的ruby实现设置为默认值,这样'哪个ruby'显示'~/.rvm/ruby-1.8.6-p383/bin/ruby'但是当我在emacs中打开inf-ruby缓冲区时,它使用安装在/usr/bin中的ruby。有没有办法让emacs像shell一样尊重ruby的路径?谢谢! 最佳答案 我创建了一个emacs扩展来将rvm集成到emacs中。如果您有兴趣,可以在这里获取:http://github.com/senny/rvm.el
我想在Ruby中创建一个用于开发目的的极其简单的Web服务器(不,不想使用现成的解决方案)。代码如下:#!/usr/bin/rubyrequire'socket'server=TCPServer.new('127.0.0.1',8080)whileconnection=server.acceptheaders=[]length=0whileline=connection.getsheaders想法是从命令行运行这个脚本,提供另一个脚本,它将在其标准输入上获取请求,并在其标准输出上返回完整的响应。到目前为止一切顺利,但事实证明这真的很脆弱,因为它在第二个请求上中断并出现错误:/usr/b