android - 这么多的扩展库问题 [英] android - so many problems with the expansion library

查看:181
本文介绍了android - 这么多的扩展库问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用新的谷歌播放(或市场)扩展库,我很难与此同时使用。
i想知道有没有人在使用它,并注意到我可以看到相同的问题,所以如果你能帮助解决他们,我会很高兴:

i need to use the new google-play (or market) expansion library , and i have hard time with it . i wonder if anyone else is using it and notice the same problems i can see , so i would be very happy if you could help be to fix them:

1.有时候我没有收到重要的事件(例如错误)回到下载器活动。

1.sometimes i don't get important events (errors, for example) back to the downloader activity .

2.it在某些设备上根本不工作,像xoom。我想我已经修复了:
平板电脑下载扩展文件

2.it doesn't work at all on some devices , like xoom . i think i've fixed it: Download expansion files on tablet

3.对于相同的设备,可以下载文件,另一个可以总是获得连接错误。对于某些设备,它将永远无法下载(甚至没有root用户的Google Play应用程序)。

3.even for identical devices , one can download the file and the other can always get a connection error. for some devices , it will never never be able to download (even non-rooted devices which have the google-play app) .

4.下载完成后,该文件可能会损坏,所以我需要使用CRC检查并重新下载所有内容。

4.after the download is complete , the file can be corrupted , so i need to use CRC check and re-download everything again .

5.通知有时会按下下载程序活动的多个实例。我也不知道为什么他们让通知停留,以防活动仍然显示。

5.notification sometimes opens multiple instances of the downloader activity upon pressing it. also , i don't get why they let the notification stay in case the activity is still shown .

6.如果发生错误并稍后处理,则不会等待用户告诉它恢复。我不知道在哪种情况下发生,但它真的很奇怪,不可预测。

6.when an error occurs and later handled , it doesn't wait for the user to tell it to resume . i'm not sure in which cases it occur , but it's really weird and unpredictable.

7.在下载器活动中,我收到泄露服务的例外。

7.upon leaving the downloader activity , i get an exception of a leaking service .

8.对于应用程序进行模糊处理,由于通过库完成SQL操作,它崩溃。那怎么和为什么呢?
编辑:这是因为google决定对SQL部分进行一些反思操作(在文件DownloadsDB.java中)。为了解决它,我试图设置proguard忽略整个库(它是开源的),但它没有工作,所以我做的是给自己想要的类,所以我有将DownloadsDB.class.getDeclaredClasses()替换为new Class [] {MetadataColumns.class,DownloadColumns.class};

8.upon obfuscating of the app , it crashes because of SQL operations done via the library . how and why is that? this is because google decided to make some reflections operations on the SQL part (in the file "DownloadsDB.java") . in order to fix it , i've tried to set proguard to ignore the entire library (it's open source anyway) , but it didn't work , so what i did is to give the classes it wants by myself , so i've replaced "DownloadsDB.class.getDeclaredClasses()" with "new Class[] {MetadataColumns.class, DownloadColumns.class};" .

我只是不明白为什么谷歌只能发布一个简单的API来向市场发送一个意图来下载文件,并检查是否可行,或提供一个不那么复杂的库。因为复杂性,很难找到并修复他们的错误。

i just don't get why couldn't google just publish a simple API to send an intent to the market to download the file and check if it's ok , or provide a much less complex library . because of the complexity , it's very hard to find and fix their bugs .

我的问题是:有其他人尝试过这个库,并有其他人在使用它时成功没有任何问题?如果是,请发布解决方案...

my question is: has anyone else tried this library , and has someone else been successfull in using it without any problems? if so, please publish the solution...

编辑:似乎谷歌已更新其库(到版本2) 。

it seems google has updated its library (to version 2) .

他们声明下一个更改:


  • 列表项目

  • 现在可以下载补丁文件。

  • 现在支持类似ICS的通知的蜂窝设备

  • 现在CRC检查(从示例中)支持压缩的Zip文件

  • 使用反射删除以允许容易的模糊化

  • 服务泄漏修复

  • 不可打印的字符从ZipResourceFile中删除

  • 次要格式更改

  • 对此文件的其他注释和修改

  • List item
  • Patch file now gets downloaded.
  • Honeycomb devices now supported with ICS-like notifications
  • CRC check (from sample) now supports compressed Zip files
  • Use of reflection removed to allow easy obfuscation
  • Service leak fixed
  • Unprintable character removed from ZipResourceFile
  • Minor formatting changes
  • Additional comments and edits to this file

我现在已经测试了,似乎他们几乎在那里。

i've tested it now , and it seems that they are almost there .

我发现唯一的错误是,如果我更新扩展文件(和APK&文件大小和CRC),下载开始,但没有删除较旧的扩展文件。

the only bug i've found is that if i update the expansion file (and the APK&filesize&CRC) , the download starts but it didn't remove the older expansion file.

此外,通知显示当前时间,而不是与下载有关的其他任何内容。

also , the notification shows the current time instead of , well , anything else that could be related to the download.

现在,由于我只有一个扩展,所以我每次从服务中获得STATE_COMPLETED状态时,都会进行下一次检查。我希望它没有任何其他问题:

for now , since i have only one expansion , i do the next check each time i get the STATE_COMPLETED state from the service . i hope it doesn't have any other problems :

private void deleteOldExpansionFile()
{
  int fileVersion = 0;
  final int versionCode = App.getAppVersionCode(DownloaderActivity.this);
  fileVersion = versionCode;
  final String fileName = Helpers.getExpansionAPKFileName(this, true, fileVersion); //get the expansion file name based on the build version of the app.
  final File newFile = new File(Helpers.generateSaveFileName(this, fileName));
  final File[] listFiles = newFile.getParentFile().listFiles();
  for (final File file:listFiles)
  {
    final String name = file.getName();
    if (name.startsWith(fileName))
      continue;
    file.delete();
  }
}


推荐答案

。你好 !对于CRC检查失败,我也经历过这个问题。解决它的东西是使用7zip的ZIP扩展文件的档案,无压缩(存储)。

. hello ! For the CRC Check Fail, I have experienced the issue too. The thing that resolved it for me was to make the archive of my expansion file with 7zip, in zip format with no compression at all (store).

像这样: a href =http://floy.fr/perso/floy/expfiles/crc.PNG =nofollow> http://floy.fr/perso/floy/expfiles/crc.PNG

like this: http://floy.fr/perso/floy/expfiles/crc.PNG

现在,CRC正在为我的魅力工作!

Now the CRC is working like a charm for me !

我同意你的看法痛苦使用..

I agree with you .. this library is very painful to use ..

这篇关于android - 这么多的扩展库问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆