How to download an image on Android wear? - java

I have an ArrayList of Serialization objects on my handheld.
I found a solution to send it to my wearable device.
Can I send custom objects to Android Wear?
In my Object I have the URL of an image and in my handheld I am using Picasso to download the image from the URL (es in a ImageView).
Can I download the image in the wearable? (I think no).
Should I download all the images of the ArrayList in the handheld and send it putting them as assets in a DataMap?

You can't download images directly from the Wear as there's no direct internet access.
However you're on the right path by downloading images on mobile (e.g. using Picasso), then transferring them to the Wear via an Asset.
There's a tutorial with all the code required on how to send an image using an Asset in the Android training section:
https://developer.android.com/training/wearables/data-layer/assets.html

Related

How to upload and receive an image to an API in Android Studio

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.

Google Photos API - a permanent url to an uploaded item for static content

I'm trying to refactor a Java application using the Picasa Web Albums API
to using the new Google Photos api.
In Picasa API you had the PhotoEntry object, which represented the uploaded entity
and one could access the URL to the uploaded image as follows:
photoEntry.getMediaThumbnails().get(0).getUrl();
This url could be used in a website as static content.
Currently I'm at a loss how to get a permanent url to an uploaded image
with Google Photos API.
There is the MediaItem object, which represents an uploaded image,
but I can't figure out how to get a permanent url from it.
I find 2 types of url in the MediaItem API:
mediaItem.getBaseUrl()
This url expires after 60 minutes and
mediaItem.getProductUrl()
cannot be used for static content, since it requires to be logged in.
Anybody can tell me what I overlooked ?
Thanks
Regards
The Google Photos Library API is not designed for image hosting. If you'd like to embed images in another site, you may need to look at other hosting solutions, like Google Cloud Storage, Firebase Cloud Storage or similar.
You are correct, base URLs expire after 60 minutes and need to be refreshed. However, if you need a permanent URL to a media item that points to Google Photos, you can create a new album, share it and use the shareableURL that's returned as part of the shareInfo property. This URL is accessible without sign in and opens the shared album in Google Photos. You can find out more in the share media developer guide.

Pi4j image transmit to Android app

I want to take an image from raspberry and recive it on and Android App (this is the problem). I already have a Java project that create an image and store it in a predefined location. I don't know how to create a server on Android app, and how to upload my image on the server. I think i will create a post webservice on raspberry to upload the image on my phone app.The image from rpi must be displayed on the phone (like notification or something). I need help on Android app, I don't know how to recive the image on the phone/how to send it from rpi location/how to show the notification when the image was send it/ how to show the image on the phone.

Generate Server Side Images for different Devices?

Case: I have an app for Android, Android Tablet, iPhone, iPad. Server has a backend to upload image (not the app). App user can browse these server side uploaded images on their phones.
The images which are uploaded from a server backend can be of square and rectangle dimension.
Note that I support all iOS devices and all Android devices. The simples way of doing it is serving one big image for all the devices.
Qustions:
What display size should be reference for the image dimension being uploaded?
Which sizes should be created on the server from the uploaded image?
you have to upload high dimension images only.In server side there is a magic view funtionality you have to implement.In App side when you got image url from server side then check your device resolution type and then set resolution size for that image in application.
You could resize the images at the time of request depending on what is most important, the speed of the request or the memory footprint.
This post gives a clear example on how to resize images.

GWT - image upload and preview

I've just watched the lib examples here... The thing is I am looking for a standard solution for GWT image upload as
A) Upload image to client app
B) Preview image in client app
C) Get image in base64 (from upload object) on client app
Is there such lib for GWT 2.3+ ?
You can use gwtupload. With Gwtupload you can upload an image,preview this image and see the progress bar with real information about the process (file size, bytes transferred, etc).
You can also choose from simple and multiple file upload.

Categories