android comparing text to save image and send via bluetooth - android

i make a project for hearing impaired people ,where two devices are connected via bluetooth , its already working sending and receiving messages but what i want is when i type a text "hi" in a editext and when i click the send button the display would be the picture in a right(girl picture) but if that picture is not available display the second picture in left side(hand sign) , is this possible? can i compare the txt i type to the drawable folder image so that , that particular image will display?... ..
plz share ur idea....

Then you will need the following:
get the text (Hi) before displaying it, by getText
check the availability of the image either you want it to be available in phone 1 or phone 2 by this method
Sure it is possible to send an image via Bluetooth, also you can code it as this example
Also my opinion is to upload the image to the firebase or let it with your application if you need it for much use
Edit : compairing file name with string that you want is like is
boolean fileExists = new File("path/to/" + name + ".png").isFile();
where name if the chat message you want to compare and surely, that code occurs before the texts/images are displayed to the users

Related

How to save images by name as 1,2,3,....n in android

My app contains the camera functionality. I have develop the app.
As the app get starts one ListView of stations will popup(Like Station1, Station2,Station3....) & user has select one item from it. Then it will open the camera activity. So once the user took a picture, the image has to be stored like 'Station1_1', 'Station1_2', 'Station2_1', 'Station2_2' inside gallery. I have covered with the initial station name(Station1, station2..). But how do I store the last portion because it contains the sequence for each Station. So is there any way to save the images by 1,2,3....?
Thanks in advance.
There is a way but it isn't appropriate. If you just want to store each image having last portion is different then you can do in the following ways:-
You can call API for just handling counter.
You can store counter in PREFERENCE, but it won't work perfect if user clear data then new images were override old one.
You can store TIMESTAMP as end portion and it is appropriate way.

Need a way to save a meteor.collection as a text file on a mobile

a newbie to Meteor, but I have created under localhost a simple passenger counter I intend to use on an android app for a passenger survey (holding a laptop in an airport isn't a particularly wise idea). It works, but there is no export function. Basically uses meteor.collection as simple rows of data - one row been one passenger with a date/time stamp, two buttons - Add Passenger and Reset. I have tried looking everywhere for a simple answer, but what I want to do is now add to the client side (on browser - but ultimately on the mobile) a button called export, and when clicked, takes each row in the meteor.collection and export it to a text file - line by line. Very simple. Alas right now I haven't got a clue how to proceed. Seen some references to FS.collection, but don't think there is what I want. This is ultimately for a mobile application.
Thanks.
JSON.stringify each object into a larger object of pure text, say bytes
Create a blob from that text object, ex: blob = new Blob([bytes]);
Use the filesaver package to save to a file locally.

App Inventor 2: Invalid Destination Address

I'm getting the error when InviteButton.Click is pressed, when trying to send the actual message. Everything else loads up as it should, I am able to select a contact etc.
I've the following block of code:
I'm using contact picker to pick the number:
Then I'm trying to call the value stored in the tinyDB and send the message like this:
And this is the error i get:
Basically I'm trying to pick a number from the contact picker, add to the tinyDB and when I press a button it sends the text message....can't figure it out.
Any ideas??
You should add some data validation before sending the message, something like this
By the way, the if true statement does not make sense, you can remove it...

Android: How to getNetworkOperatorName and location from incomming/outgoing number?

I am Developing a simple application on CallLog.Calls. I am also following Calllog.Calls .I am Getting all the call details like.. callername , caller number , calltime , duration..etc. As per the requirement I need to check the unknown number location/caller networkprovidername like TruecallerApp and like this image
In short I want to know how can i get or trace the Caller Locationprovidername from the incomming/outgoing number in android programatically ???Is there any database i need to create with all the related data or any other way to solve this?? By using telephonymanager.getNetworkOperatorName() i can get the own device operator name similliraly i want to get for other number. Any Idea Please Rply soon .
Thank you :)

Android autofocus

I am new to android and just created an android application consisting of many images and a few buttons suppose like john, what I want is whenever a person clicks on john, all the images with names including john will get highlighted.
Thanks in advance.
for exmple of Jhon:
Just follow the steps:
1)setOnItemClickListener on images
from that you find all about the selected image throgh function get getResources()
you can fetch the name from that.
2)After fetchting the name fire one query like "selected name "
it should display result name "Jhon"
3)Display name picture as per your requirement.
or
4)If you want to display into the same you can
let me know if you have any query for it.

Categories

Resources