I am creating a messaging app like watsapp and other messaging app.I have implemented messaging and easily able to chat with contacts but now I want to add contact image functionality to my application so that each contact will be able to upload there image and other user will be able to view contact image when they click on view contact.
Also for each contact view on AppBar I want to show image in circular shape for contact.
What you want to do can achieved by saving the user's contact images to the server . There is no in-built functionality for storing the images of user inside smack Library so you have to implement that on your own . Send the user's images to the server (e.g. by multipart) and also you would be needing some server-side code to handle the images (saving and providing downloading functionality ).
Related
I want to update the profile photo and name for the User Profile in Contacts App from another app in Android. I could not find any way to do that. I have referred Android documentation to modify contacts and Android documentation for User Profile. Can anyone suggest how to update profile photo and name from another application?
You‘d want to sent a Contact.Intent from the App with the coresponding data so that the Contact App can handle the Intent and update the coresponding contact.
I am trying to create an app using Android Studio. My client wants to create an app for their online medicines website, wherein the user can take a photo of their prescription, the photo will be accessible by the admins and they can use that image to understand what does the user require and deliver those medications at the user's doorsteps.
So can anyone please guide me through with making this page, or maybe share a link where the making of such a page is shown? Would be really helpful, thank you for giving me your time.
There can be several possible approaches for this type of questions/requirements. I am mentioning a few steps to guide you through the process.
You will have to create a webserver, which will be storing the user data (profile, uploaded prescriptions, etc.). The user data (textual) will be stored in the Database, however, the images will be uploaded in a directory over the server, and their corresponding links will be stored in the DB for reference.
There will be a webserver API which will fetch user data (user unique ID) from app and then store it in the DB. The image part can be accepted in several ways: MultiPart, Base64 encoded, Byte Array Converted
All these methods will send the image info from the android app to the webserver, which will follow the logic mentioned in Point 1 and save the image.
The Android app will have an activity where the user will either capture an image of the prescription form, using Camera, or can upload the image (if already captured/downloaded). You will have to learn doing this from similar links as these:
https://developer.android.com/training/camera/photobasics
Dialog to pick image from gallery or from camera
The Android app will send the unique ID of the user, along with the image data, to the Webserver API, which in-turn process as per Point 2.
You can start implementing the process and then can turn up to StackOverflow again for guidance. There are numerous tutorials to implement a similar functionality too.
https://www.simplifiedcoding.net/android-upload-image-to-server/
http://programmerguru.com/android-tutorial/how-to-upload-image-to-php-server/
https://www.codepool.biz/take-a-photo-from-android-camera-and-upload-it-to-a-remote-php-server.html
All the best!
I am creating a messaging app like WhatsApp in Android. What is the name of the control that is used to display the messages? For example, if I open my chat history in WhatsApp, it'll display all my chat history with a particular user. Is it just a ListView or something else?
It's called RecyclerView, I would suggest to take a look on this useful lib:
https://github.com/madhur/android-chat-starter
I have an app that can show a stream of tweets from a twitter user.
I want to add the app to the device contact screen so when the user opens a contact there will be a button for my app in the same page under connections (like the button WhatsApp added to my contacts). So when the user clicks it my app activity will be called containing some info about the contact that was clicked. Then, I'll make the connection between the contact info and his tweeter account in my app and display his tweets.
How can i implement this? Where do i begin?
You will have to add your own mime type for the data associated with the contact. Then you will have to register for that mime type in your app.
You can see the sync adapter
This link would definitely help you out.. http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-2/
I am developing a chatting/messaging app and I want to let the user select an image that they've stored online (i.e. picasa, photobucket, flickr, etc) which will be shown as part of the chat User Interface for anyone that is chatting with the user.
For example:
User_A is messaging/chatting with
User_B.
User_B will see a small thumbnail
image of User_A
User_A will see a small thumbnail of
User_B.
note: my web server is facilitating the text exchange between the two users.
At first I thought I would implement a photo upload function in my app and store the photo's on my server that each client would download. But then I realized that this is just re-inventing the wheel because there are now a lot of online picture sharing services.
So I want my server to simply store the URL of the images that User_A and User_B have selected - my app is notified of the URL's and downloads the pictures.
However, how is this implemented ? (Specifically, the image selection to obtain the URL in a userfriendly manner)
I've visualized the following userfriendly use-case...
user opens the options activity in my
app and pushes the button to select
an image to present in the chat UI.
an intent dialog is shown with all of
the possible image hosting services
installed on the mobile phone
(picasa, photobucket, etc) - but
local storage shall not be shown.
the image picker of the chosen
application is shown and the user
chooses the image.
the image picker closes and returns
the URL to my app.
If this can't be implemented, then my only alternative (that I know of) is to have users copy'n'paste the URL of the image they want to use - which is not userfriendly on mobile devices.
Any help is greatly appreciated.
That doesn't seem very difficult to me.
You can predefine which Image hosting services you wish to use.
Picassa and Flickr have their APIs AFAIK.
Present user with an option to choose from your predefined offerings.
When they choose, present the album of the user.
When the user ends up selecting an image, Image hosting will let you know about their URLs (You can download all images of that album and display them natively in your app, it will fetch information about them, like their URL with them, which will be easy to track)
Get the URL, and update the chat webservice about it.
Create the Chat activity in a way that it polls your webservice after a particular interval to check whether any one of both the users involved in chat have changed their images. If they have, load the new one.
I can detail you on this if you have any doubts.