Telegram send unsaved contact - android

Short: Is there any way to send phone number of unsaved contacts in telegram?
Long: I need to send unsaved contact to telegram bot like 20 times a day.
I know, than I can open phone app > go to "recent" tab > click on unsaved phone number > copy it > switch back to telegram > paste it. Is there any way to send it automatically or simplify this process?
I am not asking you about fully working program. Just tell if it is possible or give me ideas.
So far, I found that it is possible to send my phone number to telegram bot via API. But can't find a way to send unsaved contact.
Also, telegram has built-in feature to send contacts, but it works only with telegram contacts, not with unsaved phone numbers.
So far, I came up with using auto clicker.
This may help you:
My phone is Android device. I am using default Samsung phone app. And I have full control over that telegram bot.
Links:
Telegram API
Telegram API #2
Telegram API #3
Example of unsaved phone number in contacts app

You can send contacts using a code like below when you program in Telegram Bot API:
await Bot.SendContactAsync(update.Message.Chat.Id, Phone_Number, "First_Name", "Last_Name");
Here inside your own app (which could be telegram android bot) you can access your phone's call log and replace the Phone Number (which is a string) with phone numbers that your bot extracts locally.
By the way, Last Name is optional in the code that I mentioned.

Related

whatsapp hyperlink - combine whatsapp://send? with intent://send/

It's possible to have a button in my web page, for sending pre-filled messages to specific number?
i'm trying with
intent://send/+391234567890#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end;whatsapp://send?text=
nothing result.
have a solution? Thanks
Firstly, write the country code without +
Message me in WhatsApp
Sadly this does not work unless the number is already in your contacts list! Making it useless.
Here's what happens for me: I get a modal dialog saying the user is not on WhatsApp and I can either Invite or SMS. This is a mistake - they're DEFINITELY on WhatsApp, but not in my contacts because I've deleted them for testing.
Workaround idea
Offer vCard to save to Contacts
Since the phone number has to be in the Contacts list first, let's get it there. Track the site visitor to see if it's the first time she tapped on Contact me on WhatsApp (a cookie?). If it's the first time she tapped, make the link download your vCard
href="johnsmith.vcf"
The user now has to open the downloaded vCard with the People app, and add you to her Contacts.
Android intents URI FTW
When she returns, assuming she added you, make the button work with the intent:// URI scheme.
href="intent://send/391234567890#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end"
She taps on it and is magically transported to a WhatsApp chat with you.
Keep track of which href to present
Hopefully you can use the cookie you set to track her so you don't have the button offer the vCard AGAIN. There's no other way to know if your number is in her Contacts list unless you ask. But then it's not a button anymore, it's a form.
Same goes for Telegram. Security implications are probably the ones keeping Instant Messaging not so instant.

Sending an address by SMS

I have an appointment booking service that I want to be able to send the store address via SMS to the customers. I know I can just put in a regular address and Android and Apple will let you click on it to put it into the maps application. However, the addresses can sometimes be long and blow past the 160 char limit, meaning the customer gets a split message.
What I'd like to do is put the address in a URL shortner and have that be clickable to go to the maps app. My understanding is that if the link redirected to a geo:lat,long link that it would do that but it doesn't seem to work.
Can you suggest how to use a shortened URL that would allow a click to go to the map app on cell phones sent over SMS?
Look into TinyURL.com, it gives smaller url's. You still have enough space left for normalish adresses. Here even seems a way to call it from java.
http://www.mularien.com/blog/2008/12/04/tutorial-accessing-the-tinyurl-api-from-java/
Try it for yourself by following this link: http://tinyurl.com/outx83r
Option 2 would be a use a more modern system like WhatsApp, or your own message app.

Allowing my app to send a file to another device via MMS/Email

I'm developing an app and one thing I would like to do it allow users to send/share data from the app with others vi MMS or by email. I have been searching but haven't found anywhere to get started on solving the problem.
Basically, I am going to programatically draw the data from an SQLite DB and put it into a delimited file (similar to a .csv) then I want to allow the user to 'export' or send it via MMS or Email. Does anyone have any tips on how I can get my program to open the messaging application and add the attachment at the users direction? Really just need some beginning info so I have a place to start.
Here is what you are looking for. This should be a good start
launch sms application with an intent

How to beam a contact from you app (using NFC) and save it in contact list on receiving device?

How would you beam a contact using your own app (and using Android Beam) to another device and have it saved in their contact list (i.e. the default contacts app). The contact on the sending device will be provided by the ContactsContract provider.
Preferably I don't want to have the other device running my app. The built-in contacts app (Android's default app) can beam and receive contacts. So it should be possible to beam a contact using a custom app to the built-in contacts app.
The answers to this question suggest that it's possible and that you can use the VCARD format.
Currently, my app will search for a contact by phone number, then display it in a new activity (which is the built-in contacts app). See below.
Uri uri = Uri.fromParts("tel", number.getText().toString(), "");
Log.d("ContactPicker", uri.toString());
startActivity(new Intent(ContactsContract.Intents.SHOW_OR_CREATE_CONTACT, uri));
// Example log message for the number (123)-123-1234 is "tel:(123)%20123-1234"
I'd prefer to do it this way, but don't think it's possible because I can't return the contact that was found (or the contact that was created if no existing one was found). And I need that information if I want to beam that specific contact.
I'll probably need to query all contacts, find the contact I'm looking for and save its ID.
Note: I'm using API 14
Edit
I made a proof of concept app that does this: https://github.com/dideler/HiFive
The app might be buggy. It's not maintained, but pull requests are welcome.
Yes, vCard is the way to go. It is the format that the built-in Contacts/People app will pick up. It is also the format that the app uses to store its own data, and I believe.

vcard manager in android

I want to make VCard manager in android for 1.5 and above . This application will be able to perform following functions:
1 Send and receive contact . I want that when i send a contact to any mobile it should get the save option to save the contact and if some send me a business card then i should be able to save it in my contacts.
Can you please suggest me how to do it.
Is there any particular format for sending a VCard . For eg in nokia phones we are able to send a contact and its details(email etc) in form of business card and the other person can save it .
Can the same thing be achieved in android ?
Regards
Gaurav Gupta
# Keenora Fluffball
HI i am able to fetch the contacts details and able to send it in the format specified by you.. when i receive vcard in that format i want that i should get a save to contacts option. Though i can do this by using broad cast receiver. if a message contains text like BEGIN:VCARD
BEGIN:VCARD
VERSION:2.1
N:Gaurav;TEL;PREF9780898201
END:VCARD
But what about the other phones whether they will respond to it like in nokia we get popup business card received.
I want it to work on all phones. whether it is nokia or android.
Please suggest..

Categories

Resources