dropbox api exception android - android

When i tried to download a file from dropbox using dropbox api in android then i got a exception something like this
DropboxException:DropboxServerException (nginx): 400 Bad Request ('rev' is not well-formed: "/storage/sdcard0/SMSbackUpTOSS/DropBox/allSMS_01-Sep-2015.txt")
I am getting exception in this line
fd = mApi.getFileStream(fileSelected.path,
localFile.getPath());
Because no other line under this works.
But the same code in another project works fine. I dont understand why i am getting this exception!!!

mApi.getFileStream(fileSelected.path, localFile.getPath());
the second parameter here is rev, that is the revision of the file.
You should try to use null if you want the latest revision.

Related

Podio Android SDK item create API call error "Object not found"

I have a problem with the Podio SDK on Android in the following scenario:
I have uploaded an image to Podio from our server in a php script and returned the file_id to my Android app via http. The id seems to be valid, but when i try to create an item using this file_id for an image field value i get the following error messages:
E/Volley: [49051] BasicNetwork.performRequest: Unexpected response code 404 for https://api.podio.com/item/app/17418679
com.podio.sdk.ApiError: {"error_parameters":{},"error_detail":null,"error_propagate":false,"request":{"url":"http:\/\/api.podio.com\/item\/app\/17418679","query_string":"","method":"POST"},"error_description":"Object not found","error":"not_found"}
If i do not attach the image the item create call works fine
I used the newest version of the Podio Android SDK from Github (https://github.com/podio/podio-android) compiled using Android Studio 2.3 and build tools version 25.
I already found an error where the wrong app_id was used, but fixing that still left me with the same message.
This used to work only a few weeks ago, maybe there was change in the API? Do you have any tips on what else could cause this problem? I am using different client id / secret in the php script than in the app, could that be the reason?

Unable to request ads from server due to network error- IMA SDK Error and iOS

I am using IMA SDK (iOS - Swift) to play pre-roll ads(Wrapper VAST 3.0)
But when i use this url "http://fusioniprojects.com/rnd/addpod/adpods.xml"
I am getting following error in my log
"Unable to request ads from server due to network error."
and when i am using the url of this type -
"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dredirecterror&correlator="
its running fine.
I fallow the solution of this problems from here ( ref - https://groups.google.com/forum/#!topic/ima-sdk/DqE5GruzwwA),
Now its Playing only 1 ad in Android project,not multiple ad and not working for iOS at all.
It may be that I am doing some things wrong in my iOS project but i also downloads the sample project from IMA-SDK (ref - https://github.com/googleads/googleads-ima-ios/releases), But it did not help me to come out with this problems, I am getting same error.I don't know how is it running (at least 1 ad) for the Android project after changes on the server.
Is it problems of IMA-SDK? or am I doing something wrong?
Used IMA SDK version 3.3.1 in iOS.
If you are using Apache sever then To add the CORS authorization to the header using Apache, simply add the following line inside either the Directory, Location, File or VirtualHost sections of your server config (usually located in a *.conf file, such as httpd.conf or apache.conf), or within a .htaccess file: below of the code put inside .htacces file.
Header set Access-Control-Allow-Origin '*'
Header set Access-Control-Allow-Credentials true

An error occured when attemping to generate client libraries

I've kept the updates ON in Eclipse, so may be Google app engine is causing the problem,Still didn't got the solution.
The Error log is here
java.lang.reflect.InvocationTargetException
at com.google.gdt.eclipse.appengine.swarm.wizards.GenerateSwarmApiAction$1.run(GenerateSwarmApiAction.java:82)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 17090
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:180)
at com.google.gson.Gson.fromJson(Gson.java:755)
at com.google.gson.Gson.fromJson(Gson.java:721)
at com.google.gson.Gson.fromJson(Gson.java:670)
at com.google.gson.Gson.fromJson(Gson.java:642)
at com.google.gdt.eclipse.managedapis.ManagedApiUtils.findAndReadDependencyFile(ManagedApiUtils.java:185)
at com.google.gdt.eclipse.managedapis.ManagedApiUtils.findAndReadDependencyFile(ManagedApiUtils.java:179)
at com.google.gdt.eclipse.managedapis.ManagedApiUtils.findAndReadDependencyFile(ManagedApiUtils.java:179)
at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmServiceCreator.copyToConnectedAndroidProject(SwarmServiceCreator.java:148)
at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmServiceCreator.create(SwarmServiceCreator.java:453)
at com.google.gdt.eclipse.appengine.swarm.wizards.GenerateSwarmApiAction$1.run(GenerateSwarmApiAction.java:80)
... 1 more
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 17090
at com.google.gson.stream.JsonReader.expect(JsonReader.java:339)
at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:322)
The Problem is:-
I've created a project with the app engine and was running perfectly but to due to some error in build path i've deleted the project and the app engine from the workspace and imported it again.
Now whenever i generate client libraries from app engine then this error is coming.
I've tried cleaning project,closing and reopening eclipse then also its not working
please help me.
Edit
I've copied the same code in new project and its working fine but not in old project
Did you clean the project ?
First for all these issues have to clean project.
If it remains the error then check with Android Library you are working with.
Be assured of using latest Android Library that is 4.3 to 4.4.2.
If still remains the issue there might be problem with Google Api package reference.
Then add Google API reference 4.3 by going to properties of the project
Expected BEGIN_OBJECT but was STRING at line 1 column 17090.
this line shows that there is an issue in your json input string that you are giving as a input to the gson. if you resolve this, your problem might be solved.
Please Turn off Google AppEngine Updates before proceeding the steps.
Steps to turn off Updates of eclipse is:-
1) Window->preferences->Install/Update->Automatic Updates(Uncheck it)
Steps followed while creating the new project which resolved me the error is:-
1) Create New Android project.
2) Right Click on project then Google->Generate App Engine Backend which creates a new project named Project-AppEngine
3) Copied all the Entities and the endpoints in AppEngine project.
4) Now I tried to generate the Cloud Endpoint Library and it worked.
This answer is just to escape the problem if you are facing it.

Error in Generating client library(Android) From Google app Engine(in Maven)

I am in the process of learning to create google-app-engine as well as to generate Endpoint client library(for Android) from my app-engine application.
So far I have done the following things
Step 1 : Create Endpoint API : Complete
I have followed the instructions given here(using Maven) and have successfully deployed the app-engine application
https://developers.google.com/appengine/docs/java/endpoints/getstarted/backend/
Step 2 : Generate Client Library(for Android) : Getting ERROR here
I have followed the instruction here
https://developers.google.com/appengine/docs/java/endpoints/gen_clients
I gave the following command from the root directory of my app-engine application
endpoints.sh get-client-lib Greetings
But getting the following error
Dec 16, 2013 5:47:43 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
SEVERE: Received exception processing ./war/WEB-INF/appengine-web.xml
com.google.apphosting.utils.config.AppEngineConfigException: Could not locate /Users/raj/Documents/workspace-maven/helloendpoints/./war/WEB-INF/appengine-web.xml
Give below are my questions,
Is this command execution right?
endpoints.sh get-client-lib Greetings
In the documentation in google ; the second argument is
specified as 'get-client-lib' I have given the same name while
executing the command ; is this right?
As you can see in the error ; it describes ; file -
helloendpoints/./war/WEB-INF/appengine-web.xml could not be located.
The file is indeed available in my application, but is located in a
different directory(indeed in 3 locations) ; What should I do here?
./src/main/webapp/WEB-INF/appengine-web.xml
./target/generated-sources/appengine-endpoints/WEB-INF/appengine-web.xml
./target/helloendpoints-1.0-SNAPSHOT/WEB-INF/appengine-web.xml
The documentation suggest me to edit 'web.xml' file. But the file is
available in 3 location and am not sure which one I have to edit(I
have edited the file in 3rd location)
./src/main/webapp/WEB-INF/web.xml
./target/generated-sources/appengine-endpoints/WEB-INF/web.xml
./target/helloendpoints-1.0-SNAPSHOT/WEB-INF/web.xml
I am finding it quite difficult to resolve this issue ; as there is no other documentation (or) examples available in web other than the Google official documentation.
Would appreciate if some-one can help me to resolve this. Thank you.
you just need to make sure that, you directory exist and that you have the required files into the directories. I can also use the maven goal to make the generation, I read a complete article on the issue here. http://thenavigatorme.blogspot.com/2014/05/how-to-resolve-google-cloud-endpoints.html
Hope this helps.

Getting error of parsing the package during updating my new version of apk

Android Experts, I have installed signed apk (version 1.6) and on my server I've uploaded apk( version 1.7). Now I am facing problem during Update my apk from server.. I also got Dialog box for Updating but at the end I am getting error as
"Parser Error, There is a problem parsing the package." . I found some solution from some links but it doesn't work.
I am waiting for your suggestions, any ideas and your solution.
Thank U.!
You can check following things in your code
1. Already installed Apk name and updated apk name should be same.
2. Both Android Manifest contain same android:minSdkVersion value.
Yeppiee... finally I got my solution.. Actually I put wrong file path during Updating code on "onPostExecute".. So thts why I could not Update my apk and was getting "Parser Error, There is a problem parsing the package"
And One more thing If U r update your apk from server U must have following things:
- installed Apk name and updated apk name should be same.
- Both Android Manifest contain same android:minSdkVersion value.(Here My Android Tablet 4.0.3 and I put minSdkVersion:14)
- And Last If U r using asp.net U must Add .APK MIME Type to IIS - Microsoft Server Support. In IIS there needs to be a MIME type added to allow IIS to support the .APK file type.
Check this link

Categories

Resources