I am trying to write an app in Android that when requested will download a specific file from DropBox if the file is available.
I have gone through all of the tutorials in the developer section on the DropBox site but I don't think they are really detailed enough as each of the tutorials seem to have bits missing and I haven't been able to get any of them to fully work.
I have tried examples of both uploading/downloading files from the tutorials but each time I get to this part of my code I get Exception errors. This leads me to believe that I have missed something out so I was wondering whether there was a decent tutorial anywhere that properly explains the process of downloading a specific file (rather than bringing up DropBox for the user to select the file) from dropBox so that I can follow it through and hopefully will help me to understand where I am currently going wrong.
I know there are lots of questions similar to this but most of them state that they can get part of the process to work and need help on a particular part but I don't seem to be able to get anything to work other than the actual linking to my DropBox account (I have created a DropBox app and have added the keys etc. to my software).
If anyone can help point me in the direction of a decent tutorial that properly explains this process I would be grateful.
Thanks...
I thought I should expand on my issue which hopefully will help to identify the problem that I am having.
The main tutorial I am using at the moment is: https://www.dropbox.com/developers/core/start/android
I have created an app in the App Console which allows file sharing; this has also given my key and secret code.
I have downloaded and installed the mentioned SDK and have added it to my project; I know this works as without the SDK installed most of the code produces errors.
I have added the beginning part of this tutorial which sets up the authorization to DropBox from my app; this works as when I test it I am taken to a page on my device that requests that I select the correct DropBox account. Up to this part I have no issues with and it all seems to work.
The next part of the tutorial mentions uploading/downloading files and reading the directory structure. I have tested all of these separately but for each one I get an Exception error; the errors seem to mention something called "json" and a class not being found. The tutorial does not mention needing to install another SDK or any other library files so I am unsure whether it is assuming that something has already been done which I have not known about so hasn't been done.
I hope this makes sense and would appreciate any help you can give me...
It looks like the error is related with JSON library you used to connect with Dropbox server. here is the libraries list I used for my application, it works well and can download the file to cache.
dropbox-android-sdk-1.6.1.jar
dropbox-core-sdk-1.7.7.jar
jackson-annotations-2.2.3.jar
jackson-core-2.2.4.jar
jackson-databind-2.2.4.jar
The library jars in the dropbox-java-sdk-1.7.7 package are not enough.
Related
I'm tired to see a lot of Stackoverflow questions about this, even in Google forums or Google official support site, publishing "solutions" that lead to uninstall package through ADB, to do something with the phone rooted, to delete cache of Google Play Services, etc ...
https://code.google.com/p/android/issues/detail?id=64514
https://support.google.com/googleplay/answer/3300875?hl=en
http://gizmostorm.com/how-to-fix-package-file-is-invalid-error-on-google-play-store/
https://www.google.com/search?sourceid=chrome-psyapi2&ion=1&espv=2&ie=UTF-8&q=android%20upgrade%20download%20invalid%20package ...
etc ...
Is there any solution from the package side ?
I mean, I have an app with hundreds of thousands of installs, and unfortunately many users are complaining about this error when upgrading from store my new version.
Obviously, I can not go one by one telling they have to do this or that, because they are not developers, they just want to upgrade and run an app !
Some users are telling me (complaining) this happened since the last "upgrade attempt" of my app, and they are not experiencing this "package file is invalid" with any other app in their phones.
So, I guess it's something I can fix with another upgrade.
Is there ANY SOLUTION that I can do in the next APK compilation, uploading to Google Play Store and fix this without "bothering" my users ?
Thank you in advance
I have also faced same issue in my project as well. I was adding many more features with new jar, git open source library code for Nice UI.
For searching for solution I found play store has issue in one of its updates
http://www.androidcentral.com/google-investigating-package-file-invalid-errors-google-play
But this is totally not relevant to my problem
Again searching I found this
http://birbit.com/how-to-solve-linearalloc-problem/
So the solution looks to be loading a few jar files dynamically using DexClassLoader.
http://android-developers.blogspot.in/2011/07/custom-class-loading-in-dalvik.html
Prepare Interface of the jar file (list of all classes and methods) and have the interface in the app - Need to see how to do this. - We can just have those classes which we need in our app and ignore the rest of the classes. This way we can implement for few existing jars and any new jars that we have to add to make sure we don’t run into this issue again.
Keep the jar in assets folder
Load every class from the jar (based on the list of jars we have in the interface). (The classes will be loaded just once on first launch)
But Based on this, this looks to be involving lot of coding changes and a time consuming things.
Moreover I found that facebook also faced same issue in their initial android app
https://www.facebook.com/notes/facebook-engineering/under-the-hood-dalvik-patch-for-facebook-for-android/10151345597798920
Final Approach I took was removing additional code from jar/git library project which is not require for my application. after that my app got install on 2.3.X with no error.
m using the android youtube player OpenYouTubeActivity, i'm using the svn source code, not the jar file provided in the project. But it seems that this activity is not working after the 4.3 android releases. the video is shown half of the full screen, but everything else works fine. THis issue is already logged on the issues list on the project site.
Anybody has any clue, whats happening? Any solution is greatly appreciated.
Its always best to use the jars, because you get the latest compiled code and its easy for the maintainers to maintain versions. But I think on the code branch the fix here is to decompile the jar using an open source decompiler like http://jd.benow.ca/ and then copy the code as is.
Then you can see where the changes have been made.
DISCLAIMER
Please follow the licensing as the original wants it. I think its as per Apache, so make sure to include appropriate licensing information and credits and follow licensing laws.
I have been searching around this site and google for a couple of hours now, and I can't find anything about this. Maybe because I use the wrong search terms, I don't know.
I am making an Application List for an App of mine, and for the most part this is easy enough. My problem is that when I come across an updated system application, I need to get information about the original package file (The one in /system/app rather than the updated one in /data/app), information like version and file name.
Now, I could extract this as root from /data/system/packages.xml, but I thought that there might be a better native solution using PackageManager like with the rest of the application list?
I'm curious about debugging some of the error codes I get from the MediaPlayer... specifically the "AwesomePlayer" and "StagefrightPlayer" sub-modules
I found this "Android Open Source Project" on the internet that seems to expose some of the code driving these modules, or perhaps it is emulator-code in much the same way the public WINE source codes expose the emulators "interpretation" of the real code
https://www.codeaurora.org/git/projects/qrd-gb-dsds-7225/repository/revisions/f6156a77044113680d038934b06bde333a1e69ea/entry/frameworks/base/media/libstagefright/HTTPDataSource.cpp
but regardless of whether it is emulation or true original source, I'm interested in getting numerical translations for the following:
UNKNOWN_ERROR
ERROR_IO
ERROR_ALREADY_CONNECTED
ERROR_NOT_CONNECTED
ERROR_UNSUPPORTED
and I'm also interested in getting human-readable translations of the following numericals:
-1002
-1007
mainly I've studied the HTTPDataSource::connect and HTTPDataSource::connectWithRedirectsAndRange functions
I've browsed around some of those codeAurora pages looking at various .h files that seemed related to HTTP and MediaPlayer but couldn't find numerical translations for those error codes... I also tried using the codeAurora Search bar at the top to find them, but didn't have any luck with that either.
I'm beginning to think I need to learn how GIT works and download the whole source tree to my hard drive and then search for those #defines and the negative numbers using an advanced text editor or the VC2010 IDE
but before I do that I thought I'd post here and see if anybody has any insight, tips, or maybe even knows those codes?
You can see the error codes here:
https://www.codeaurora.org/git/projects/qrd-gb-dsds-7225/repository/revisions/af8ce7dda6594bb7bff9ada69051c7a9365c3b50/entry/frameworks/base/include/media/stagefright/MediaErrors.h
I just dowloaded the Google IO Source code from here: http://code.google.com/p/iosched/ in order to understand the great UI of this app.
I also wanted to grab the code of the Twitter LiveFeed, but when compiling freshly downloaded code, I get a crazy UI:
I don't understand what's wrong as I didn't changed one line of the code!
Does this issue happens on other people devices?
Thank a lot.
I answer myself in case other people also searching for the answer:
http://twitter.com/#!/romannurik/statuses/69818965840506880
yes we used some custom Google
Realtime Search tweaks that I
explicitly removed from open source.
So that seem impossible for now... Or we will have to look for other alternatives