草庐IT

Commonsware

全部标签

android - 支持库中的 WakefulBroadcastReceiver 与 commonsware 的 cwac-wakeful

我正在使用通用软件WakefulIntentService进行唤醒工作。与使用commonswarelibrary相比有什么优势吗?而不是WakefulBroadcastReceiver来自支持库?这是我使用支持库的代码importandroid.support.v4.content.WakefulBroadcastReceiver;publicclassSimpleWakefulReceiverextendsWakefulBroadcastReceiver{@OverridepublicvoidonReceive(Contextcontext,Intentintent){//This

android - gradle 如何选择某些 url 来查找存储库?我如何将它指向正确的方向以便我可以导入这个 JAR?

为了获取cwac-cameracommonswarejar,我在build.grade中有这个:dependencies{compile'com.commonsware.cwac:camera:0.6.+'}当我尝试编译时,它给了我这个:Error:Aproblemoccurredconfiguringproject':app'.>Couldnotresolvealldependenciesforconfiguration':app:_debugCompile'.>Couldnotfindcom.commonsware.cwac:camera:0.6.12.Searchedinthef

android - 结合 localbroadcastmanager sendorderedbroadcast 发送广播

我想实现CommonsWare在这篇博文中描述的内容:http://commonsware.com/blog/2010/08/11/activity-notification-ordered-broadcast.html.帖子很有意义,我可以在这里浏览示例源:https://github.com/commonsguy/cw-advandroid/tree/master/Broadcast.我很好奇的是,如果在服务内部调用LocalBroadcastManager.getInstance(UnzipService.this).sendBroadcast(broadcast);仍会被您类型

android - 标准 Intent URI 损坏?

我在特定设备上遇到了IntentURI的问题,所以我按照此处的建议尝试了CommonsWareURLHandler示例:LaunchingmyappusingtheintentURI,并且其示例页面上的IntentURI超链接也无法调用该应用程序。该示例声明其intent-filter如下:示例网页中的超链接是:LinkbacktoURLHandlerviaintent:URL这适用于大多数设备,但不适用于运行Android4.0.3的HTCAmaze4G。当我触摸链接时,logcat给出:I/PRIME(9029):SendtoWebViewClient.I/PRIME(9029):

android - 为什么食谱在似乎没有必要时提倡覆盖 getItemViewType 和 getViewTypeCount?

我一直在研究CommonswareAndroidProgrammingTutorials,在教程5中,额外学分2,挑战是根据对象的"typename"(餐厅的“type”属性,它是一个字符串)。因此,它建议在自定义ArrayAdapter中覆盖getItemViewType和getViewTypeCount。此外,androiddocs及其他onlinerecipes或blogposts建议相同。在这种情况下,遵循这个秘诀并覆盖这两个方法可以正常工作,但会导致基于检查该餐厅“类型”属性值的冗余逻辑。例如(请注意,此适配器是内部类,restaurants是声明为外部Activity成员的

android - 开发报警应用

我想开发一个警报应用程序。该应用程序应该像这样工作:启动它Activity显示时间我可以设置闹钟我可以关闭应用程序当闹钟时间到来时,它开始一个Activity(即使设备被锁定)我已尝试改编此示例https://github.com/commonsguy/cwac-wakeful但是当闹钟时间到来时我无法启动Activity。我使用此代码设置闹钟(为了测试,我已将此代码插入到Activity的onCreate方法中):Intentintent=newIntent(this,OnAlarmReceiver.class);PendingIntentpendingIntent=PendingI

java - Android:如何知道Commonsware 的WakefulIntentService 是否在运行?

我有一个简单的问题:我在我的应用程序中使用了commonsware的wakefulintentservice并且我让它工作了,但是我怎么知道WakefulIntentService是否仍在运行?例如,我可以在WakefulIntentService类中放置一个onDestroy并让它记录一些东西,还是有其他方法可以查看WakefulIntentService是否正在运行?提前致谢! 最佳答案 I'musingcommonsware'swakefulintentserviceinmyapplicationandIgotitworkin