Sending simple text with bluetouth to the phone

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5527
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Sendint simple text with bluetouth

Post by Kwai chang caine »

Ahhh !!! ok !!!! I have understand now :oops:

In fact, your tips is a little bit like i do for the moment
I have create a simple internet page on my server
I paste the text on my site with my PC Firefox and i copy the text with my Android Firefox and paste it with the clipboard :D

I can record several lines, i write or paste text in the bottom StringGadget
I click on the button "Enregistrer" (Record) and a part of the line appears on the ListBox from the top
And in the other sense, i can choose a line in the ListBox from the top
Click on the button "Afficher texte sélectionné" (Show selection text) and the line selected appears this time in the bottom StringGadget
After i click on the button "Copier dans presse-papier" (Copy in clipboard) and the text showed in the bottom StringGadget is now in the clipboard :D

Image

But i thought it's possible to send a text to the phone by another way, in case for exampler, where there have no network internet :wink:

So thanks a lot at all, for your precious help
Have a very good day 8)
ImageThe happiness is a road...
Not a destination
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: Sending simple text with bluetouth to the phone

Post by Marc56us »

Another simple way to transfert datas phone/phone or phone/computer: QRCode (25 to 4296 char)
(Some browers like Vivaldi have a QRCode generator on address bar)
:wink:
infratec
Always Here
Always Here
Posts: 7701
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Sending simple text with bluetouth to the phone

Post by infratec »

If you install TotalCommander on your Android smartphone, you can send files via the OBEX BlueTooth protocol.
There is also a free software for PCs which can send and receive files via OBEX.

http://intradarma.com/apps/windows/oc

Or, if you also use TotalCommander on your PC, there is a plugin available:

https://totalcmd.net/plugring/BT.html
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5527
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Sending simple text with bluetouth to the phone

Post by Kwai chang caine »

Hello at you two :D

@Marc256
Yes, i have forgotten :oops:
The QRCode is already a more quick way for transfert txt between PC/Phone :idea:
And it's always a more close method for do that
Thanks for you idea "Marco" :wink:
Infratec wrote:If you install TotalCommander on your Android smartphone, you can send files via the OBEX BlueTooth protocol.
I take a look to your links, thanks a lot 8)
Infratec wrote:There is also a free software for PCs which can send and receive files via OBEX.
OBEX ??
Obviously it's a too much complex function, for that KCC know it :oops:
But when i have read your word "OBEX", i remembed the link of the page HEXOR have kindly give to me :wink:
https://www.purebasic.fr/german/viewtop ... =8&t=23878
with another link bottom of CCCODE_NEW about "bluetooth-command-line-tools"
https://bluetoothinstaller.com/bluetoot ... line-tools
And in this program i have also see this magic word "OBEX" :shock:
So i have tried it, and that works really nice for send files, my mouth turned into a banana and my teeth appeared, and i dancing on my desktop
Image
when i saw the bluetouth acceptance request on my phone :shock: 8)
But after, i have not found if it's possible to send a simple text with this program :|

@ALL
It's really a pity in 2022...Microsoft not add this also simple function in his Bluetouth or WIFI feature, without passing by a CLOUD or other external system
The cloud it's cool, but it's not really safe and secure, and obviously...
Without internet network ..... that works more good !!! :mrgreen:

Image

In 2022...Windows 11.. etc...and always impossible to send an "hello" txt at another machine without installing software, use cloud, a SMS, a mail, use cables, other complex or not discret system. :evil:
Finally any other system which compared to this small text, seems monstrously big
And when i think one of the first thing we learn to a child, it's say "HELLO" at everybody.... :lol:
ImageThe happiness is a road...
Not a destination
morosh
Enthusiast
Enthusiast
Posts: 336
Joined: Wed Aug 03, 2011 4:52 am
Location: Beirut, Lebanon

Re: Sending simple text with bluetouth to the phone

Post by morosh »

Sorry, may be I miss understood:
why you don't use whatsapp, you can install whatsappweb on you laptop and exchange whatever you want with your smartphone, just create there an empty group with just you inside and that's all, more it's bidirectionnal
I'm using it every day, I send sometimes android apk this way.

HTH
PureBasic: Surprisingly simple, diabolically powerful
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5527
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Sending simple text with bluetouth to the phone

Post by Kwai chang caine »

In fact i search a method "Hardware" for sending a simple text
With network cables that works obviously, but i say to me there are surely a possibilty to send a simple text by network without cable (Bluetouth, Wifi, etc ...) like we can send a full and big file, why it's impossible to send a simple "Hello" ?
Like this, no cables, no internet, no cloud and no install :wink:

Surelly an instal on the receiver for convert the received text in a file or show the text on the screen, like a MsgBox
There are a long time, in XP it exist a message we can send natively by cable network, but since W7 this option is desactived and perhaps deleted now on W10
But nothing with "aero Network" (Bluetouth, Wifi, etc ...)

It's right the better and mainly solution for the moment it's QrCode, but i must install two softs each side :|
ImageThe happiness is a road...
Not a destination
infratec
Always Here
Always Here
Posts: 7701
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Sending simple text with bluetouth to the phone

Post by infratec »

In general:

If you want do something on 2 devices, you need on each device a software which does this.
If you want to send text from the PC to an Android smartphone, you need a software on the PC and you need a software on the smartphone.

So simply write a program for the smartphone and use HexOrs tool to for the PC program.

This has nothing to do with MS or Google.
No one (ok, you) needed such a functionality via Bluetooth, so there is no program for that on the smartphone side.
infratec
Always Here
Always Here
Posts: 7701
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Sending simple text with bluetouth to the phone

Post by infratec »

Ups.... I was wrong.

Search for Bluetooth Chat (Glodanif) in the app store.
With this tool it should be possible to communicate with your PC.

Enter

chat bluetooth

in the search bar of the app store.

Glib-Bluetooth Chat
Briar
BlueChat

That's your program:
Arduino Bluetooth Chat

There is a simple code for arduino below.
It only sends and receives lines via serial port.
So if you add a bluetooth port ia PB to your PC you can chat with this app.

Or:
Serial Bluetooth Terminal (Kai Morich)

You have only to search and you will find solutions.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5527
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Sending simple text with bluetouth to the phone

Post by Kwai chang caine »

Thanks a lot for the time you lost for searching a solution for my crazy request 8)
I take a look for see if i understand this system :wink:
Master wrote:No one (ok, you) needed such a functionality via Bluetooth
And thanks to you, i know we are less two to need this function :mrgreen:
Me and the programmer of this nice Android tools :lol:

In fact, i say Bluetouth, because it's one of the only one method for send something
But i suppose WIFI or other network method are again more complicate for sending something :|
ImageThe happiness is a road...
Not a destination
User avatar
the.weavster
Addict
Addict
Posts: 1581
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: Sending simple text with bluetouth to the phone

Post by the.weavster »

Code: Select all

If Not InitNetwork()
  MessageRequester("Error", "Could not initialize the network", 0)
  End
EndIf

Procedure.s GetServerIP()
  ip$ = ""
  If ExamineIPAddresses(#PB_Network_IPv4)
    Repeat
      IP = NextIPAddress()
      If IP
        ip$ = IPString(IP) 
      EndIf
    Until IP = 0
  EndIf
  ProcedureReturn ip$
EndProcedure

Global html.s = "<html><head>" + 
                "<meta name=" + 
                Chr(34) + "viewport" + Chr(34) + 
                " content=" + 
                Chr(34) + 
                "width=device-width, initial-scale=1.0" + 
                Chr(34) + "></head><body>" +
                "<a href=" + Chr(34) + 
                "sms:?&body=*placeholder*" + 
                Chr(34) + ">*placeholder*</a>" + 
                "</body></html>"
Global port.i = 8081
Global host.s = ""
Global nTextGadget.i = 0

Procedure OpenMain()
  Define.s hdr = "http://" + host + ":" + Str(port)
  If OpenWindow(#PB_Any, 100, 100, 500, 500, hdr, #PB_Window_SystemMenu)
    nTextGadget = EditorGadget(#PB_Any, 10, 10, 480, 480 , #PB_Editor_WordWrap)
  EndIf
EndProcedure

nQuit = 0
nServer = CreateNetworkServer(#PB_Any, port)
If nServer
  host = GetServerIP()
  OpenMain()
  Repeat 
    WEvent = WaitWindowEvent(10)
    SEvent = NetworkServerEvent()

    If WEvent = #PB_Event_CloseWindow
      nQuit = 1
    EndIf
  
    If SEvent
      ClientID = EventClient()
      Select SEvent
        Case #PB_NetworkEvent_None
          Delay(10)
        Case #PB_NetworkEvent_Connect

        Case #PB_NetworkEvent_Data
          Define.s sResponse = "", sMsg = GetGadgetText(nTextGadget)
          If sMsg = "": sMsg = "Hello, World!" : EndIf
          sMsg = ReplaceString(html, "*placeholder*", sMsg)
          Define.i nSize = StringByteLength(sMsg, #PB_UTF8)
          sResponse = "HTTP/1.1 200 OK"  + #CRLF$ +
                      "Content-Type: text/html" + #CRLF$ + 
                      "Content-Length: " + Str(nSize) + #CRLF$ + #CRLF$ +
                      sMsg
          SendNetworkString(ClientID, sResponse, #PB_UTF8)
      EndSelect
    EndIf
    
  Until nQuit = 1
  CloseNetworkServer(nServer)
Else
  MessageRequester("Error", "Could not create server", 0)
EndIf

End
.
.

1) Paste your text into the editor gadget
2) Point your phone's browser to the url in the window title
3) Click the link in the returned web page
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5527
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Sending simple text with bluetouth to the phone

Post by Kwai chang caine »

Hello "the.weavster" :D

I have run you code
There are a windows with a EditorGadget
I paste "Kcc" in the EditorGadget and press or not RETURN (2 try)
I have a security message message ask to me if i allow the network
I say yes
I open my phone and paste "http://192.168.1.132:8081"
And nothing in the Android Web browser :|

Surely again a security lock :?
ImageThe happiness is a road...
Not a destination
User avatar
the.weavster
Addict
Addict
Posts: 1581
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: Sending simple text with bluetouth to the phone

Post by the.weavster »

Kwai chang caine wrote: Mon May 02, 2022 2:33 pm And nothing in the Android Web browser :|
Is that Chrome?

1) Is your phone's wifi connected to the same network as your PC?
2) Open a command prompt and type:
ipconfig
just to make sure the code has picked up the right IP address for your PC

If both of those are OK I guess it's Windows Defender Firewall
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5527
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Sending simple text with bluetouth to the phone

Post by Kwai chang caine »

Image

INNNNNNCREDIBLE !!!!
:shock:

In fact, when i have see your code i say to me : "It's already a super idea to create a server !!!" :D
But when i have clicked on the link..... i not believe my eyes, directly on the SMS... v

You are really the "MASTER OF THE TRICKS'N TIPS" with your super clever codes
I remember also your magical code for sending datas dynamicaly by HttpRequest, that you give to me there are several years also astucious that this one 8)

Thanks a lot for this code more close to my search
Now, all we have to do is find a trick to be able to connect "LIVE WIFI" between the PC and the phone for not use the router, and I'll be the king of oil :mrgreen: :lol:

MasterOfTheTricks wrote:Is that Chrome?
No it's FF or Opera
MasterOfTheTricks wrote:Is your phone's wifi connected to the same network as your PC?
Image

I have not activate the WIFI on my phone, then it have create his own IP :oops:

@AT ALL
Thanks at all the kinds members who have helped me, to compensate this also simple function which is missing for my taste :cry:
I wish at all the family a very good days
ImageThe happiness is a road...
Not a destination
Bitblazer
Enthusiast
Enthusiast
Posts: 769
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Sending simple text with bluetouth to the phone

Post by Bitblazer »

The old school solution - look into Internet connection sharing and you could use anything from google drive, network filesystems, ftp, http, mail, smb etc. etc. Another option would be a Peer to peer based solution.

A modern solution would be the use of Wi-fi direct on Windows and Android
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5527
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Sending simple text with bluetouth to the phone

Post by Kwai chang caine »

Hello Blitzblazer
A modern solution would be the use of Wi-fi direct on Windows and Android
What !!!!! :shock:
My dream is perhaps possible ?
If it's impossible by Bluetouth, perhaps it's possible by "WIFI DIRECT" :shock:
Apparently yes, thanks for your link i found this
https://www.b4x.com/android/forum/threa ... ct.102637/

Thanks for your help 8)
ImageThe happiness is a road...
Not a destination
Post Reply