Following this Tutorial to share Image From Assets Folder. Please see previous post i have added code and everything there but the only problem I am facing is I am able to share image via Gmail while failed to share image in case of Bluetooth, Facebook. Can someone please let me know what is the reason ? In case of Bluetooth every time I am getting request but when I send image it response me Fail to Sent
Previous Post
Related
I'm trying to implement an Android app that uploads an image taken by the user to an API which removes the image's background, and sends it back to the Users device.
Here is the API for more info. I'm trying to send a jpeg image and receive the image as a jpeg aswell.
The API docs state that the POST request has to be multipart/form. I don't have any experience on making API calls using Volley and was wondering if any one could help me figure out how to do it. Thanks in advance.
I am trying to develop a desktop application in Java for uploading videos. I create a new Google account, create project on developer console and create credentials (ClientID and ClientSecret). After creating all of these, i do authorization (as in java examples), the application opens browser window for me to allow the application to manage the channel, and everything works fine.
But when i try to upload a video (short video, tried it on other channels before and it uploaded every time), i immediately get quota exceeded response. And in the developer console i can see that quota is actually exceeded (9644 queries already). I must add that this is happening only for the newly registered accounts - the same video uploads without issues using the same app.
Why is this happening? Is there any way I can "register" new account and immediately do upload? If not, how can I do this properly? Thanks
I had a similar problem with the python code that i used (i modified code based on https://developers.google.com/youtube/v3/guides/uploading_a_video). I solved it using the following workflow:
create a (new) google account if you dont have one yet
go to youtube, sign up with the google account and create a channel
go to
https://console.developers.google.com/apis/credentials?pli=1
create a project, pick a name
click on OAuth consent screen, pick external, pick application name
go back to Credentials, create Credentials using OAuthClient ID, pick Web application
pick a name, put into redirect urls: http://localhost:8080/ and https://developers.google.com/oauthplayground and save
go to Dashboard, search YouTube Data API v3 and enable
then go to https://developers.google.com/oauthplayground/
click on the rack wheel on the right, click use your own credentials, copy and past clientID and secret client from https://console.developers.google.com/apis/credentials and close
search for Youtube Data API v3 on the left, and select https://www.googleapis.com/auth/youtube.upload and https://www.googleapis.com/auth/youtube
click authorize APIs, log into your account, agree to all questions asked
Click Exchange authorization code for token
the Request on the right should not give you any errors
go back to https://console.developers.google.com/apis/credentials, when you click on the edit button next to your credentials, you should be able to download your JSON files. put them into the script folder under client_secrets.json
make sure to delete the file python_upload_video.py-oauth2.json from previous trys
when running the code with for example
python upload_video.py --file="input.mp4" --privacyStatus="unlisted"
the browser should open and ask you to log into your account
what i noticed is that:
if you get three errors in three hours it seems to exceed the quota and you cannot continue
the upload works for about 5 videos a day. If you need to upload more and cannot wait the only way is to create a new account and repeat the steps above (as far as I know)
It may be worth investigating further: I guess that your issue has to do with the API issues seen since about three days now. See the answer https://stackoverflow.com/a/55220182/8327971; also Google's known and acknowledged issue: https://issuetracker.google.com/issues/128673552.
One of our core system has been integrated with a mobile app recently where we need to share images which are kept in our repository to Mobile app which is residing in another server in the same network. When we analysed solution
Send image as byte[] over the api which is getting used to call
Host image in one of the container we are running and share the image url over api
Which one is the right approach to go on with, or is there any other approach on which we can have a better solution ?
1.Upload image into server using mutipart.
2.Save image into server and make the path of it.
3.You can use then anywhere this byte of path.
Hope it helps
I am creating an authentication system where I get some value( let us say "x") after processing the android application. I want to send the value "x" to the server where I have a java file and it needs to be run on the server end(may be using php by passing the argument as the value "x"). After running, I need the output to be sent back to the android device to display it.
Leads how to implement such short structure will help me complete the system.
You need to create a class that extends AsyncTask, and then use your php source that u would normally use for login. Here's a link that might help you out: Android, PHP authentication
Try using HTML request. I am not sure how is this implemented. Any one can comment regarding it.
I am writing an application for android and i wish to be able to sync content from a web server, IE: The layouts XML to the device and cache it so that if the device is not connected to the internet it uses an old version of the XML so as soon as the device is on the internet is able to update and gather the latest XML.
Couldn't find much on the internet, so if someone could point me in the right direction or give me some ideas this would be quite helpful.
Cheers,
Alex
This is how it works with a normal xml file:
Create an on your device HTTP Client
Prepare a GET request to your server
Send the request and retrieve the HTTP Response
Read the content using an InputStreamReader
Write the Stream to a file on the external storage name it e.g. newes_version.xml
catch all exception, and just use the file newest_version.xml file.
But it can't work for Layout files
Why? Every time you load your app on an device, everything (except /raw) in the /res folder is being compiled. Therefore your 'stylsheets' doesn't exist anymore the way they did in your IDE. It's not as simple as in html/css where you can just exchange on file. (Well, you can, put not an runtime)
Solution
If you really want to change your layout on Run time, you would have to load the xml (see above), parse it, and apply the information given by file using the R.id reference of the View elements.