Jump to content

Sending A Command From Android Phone To Computer Through Bluetooth

So basically want I'm trying to do is send a command to the PC through my phone. If i click a button i want it at this time to lock the PC. This works when on PC but I'm not sure how to send a signal via bluetooth
 

Does anyone have a guide to where to find this, or a solution? Would be much appreciated

Link to comment
Share on other sites

Link to post
Share on other sites

See if you can find an app for on on google play

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, wasab said:

See if you can find an app for on on google play

I'm trying to make an app...

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, JazzaWil said:

I'm trying to make an app...

Well, in that case I hope you enjoy reading googles documentation.

https://developer.android.com/guide/topics/connectivity/bluetooth.html

 

If you are impatient like me who just wants people to tell you the answers instead of doing the homework and reading the textbooks, go post a thread on stack overflow. 

https://stackoverflow.com

 

 

Edit: you also need to develop the client app for windows. Go read Microsoft documentation on how to do that. (If you are developing for windows pc) 

Edited by wasab

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

33 minutes ago, wasab said:

Well, in that case I hope you enjoy reading googles documentation.

https://developer.android.com/guide/topics/connectivity/bluetooth.html

 

If you are impatient like me who just wants people to tell you the answers instead of doing the homework and reading the textbooks, go post a thread on stack overflow. 

https://stackoverflow.com

 

 

Edit: you also need to develop the client app for windows. Go read Microsoft documentation on how to do that. (If you are developing for windows pc) 

I've tried stack overflow and haven't gotten anything yet. I'm not sure really anyones tried to do this where they have a android device interact with the pc directly but who knows. But hey documentations better than nothing. Client apps easy mode just the connection and the sending of the command

Link to comment
Share on other sites

Link to post
Share on other sites

Before you get too far, the PC in question has bluetooth capabilities, right?

 

You could also send the signal via wifi, and use mac address binding on your local network to ensure the PC always has the same internal IP (you'd have to have a static IP to be able to reliably lock it from outside your home network though)

Gaming build:

CPU: i7-7700k (5.0ghz, 1.312v)

GPU(s): Asus Strix 1080ti OC (~2063mhz)

Memory: 32GB (4x8) DDR4 G.Skill TridentZ RGB 3000mhz

Motherboard: Asus Prime z270-AR

PSU: Seasonic Prime Titanium 850W

Cooler: Custom water loop (420mm rad + 360mm rad)

Case: Be quiet! Dark base pro 900 (silver)
Primary storage: Samsung 960 evo m.2 SSD (500gb)

Secondary storage: Samsung 850 evo SSD (250gb)

 

Server build:

OS: Ubuntu server 16.04 LTS (though will probably upgrade to 17.04 for better ryzen support)

CPU: Ryzen R7 1700x

Memory: Ballistix Sport LT 16GB

Motherboard: Asrock B350 m4 pro

PSU: Corsair CX550M

Cooler: Cooler master hyper 212 evo

Storage: 2TB WD Red x1, 128gb OCZ SSD for OS

Case: HAF 932 adv

 

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, JazzaWil said:

I've tried stack overflow and haven't gotten anything yet. I'm not sure really anyones tried to do this where they have a android device interact with the pc directly but who knows. But hey documentations better than nothing. Client apps easy mode just the connection and the sending of the command

There are plenty apps on android play store that does exactly that. Microsoft has release an app that allows you to remote control your pc with your phone. Do you still want to code your own? 

 

You should have some strong knowledge of both windows(win32) and Android APIs before even attempting. (Assuming if you are doing it for android and windows devices)

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

I have an adapter to make the computer bluetooth compatible 

Edit: so thats the reason i use bluetooth not wifi. so i have a portable option

Edited by JazzaWil
more info
Link to comment
Share on other sites

Link to post
Share on other sites

On 23/03/2018 at 4:44 PM, wasab said:

There are plenty apps on android play store that does exactly that. Microsoft has release an app that allows you to remote control your pc with your phone. Do you still want to code your own? 

 

You should have some strong knowledge of both windows(win32) and Android APIs before even attempting. (Assuming if you are doing it for android and windows devices)

Yeah i could also use teamviewer or chrome desktop support but this is to execute code like the code for locking a computer remotely from the app. I want to do this for the sake of making it. As i said before i've made this work on pc it's just now getting that command executed remotely

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, JazzaWil said:

Yeah i could also use teamviewer or chrome desktop support but this is to execute code like the code for locking a computer remotely from the app. I want to do this for the sake of making it. As i said before i've made this work on pc it's just now getting that command executed remotely

Just like most things in programming, it's often helpful to prototype and break things down. Before even thinking about the app, start by just making the most basic system that communicates over bluetooth. A very simple client on the PC, and a very simple app on the phone, just to get through learning how to actually send/receive packets through bluetooth. Once you figure out how the basics of bluetooth communication, then you can start applying that knowledge to your more complicated use case.

Gaming build:

CPU: i7-7700k (5.0ghz, 1.312v)

GPU(s): Asus Strix 1080ti OC (~2063mhz)

Memory: 32GB (4x8) DDR4 G.Skill TridentZ RGB 3000mhz

Motherboard: Asus Prime z270-AR

PSU: Seasonic Prime Titanium 850W

Cooler: Custom water loop (420mm rad + 360mm rad)

Case: Be quiet! Dark base pro 900 (silver)
Primary storage: Samsung 960 evo m.2 SSD (500gb)

Secondary storage: Samsung 850 evo SSD (250gb)

 

Server build:

OS: Ubuntu server 16.04 LTS (though will probably upgrade to 17.04 for better ryzen support)

CPU: Ryzen R7 1700x

Memory: Ballistix Sport LT 16GB

Motherboard: Asrock B350 m4 pro

PSU: Corsair CX550M

Cooler: Cooler master hyper 212 evo

Storage: 2TB WD Red x1, 128gb OCZ SSD for OS

Case: HAF 932 adv

 

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, JazzaWil said:

Yeah i could also use teamviewer or chrome desktop support but this is to execute code like the code for locking a computer remotely from the app. I want to do this for the sake of making it. As i said before i've made this work on pc it's just now getting that command executed remotely

Edit, sorry, I didn’t see your original post. My previous post would not be relevant or necessary at all. Read Android documentation. 

 

Edited by wasab
See reason above

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

Maybe look at Xamarin? It allows you to develop an app for android in c#

 

And the way I see it, there's three main components to your project:

 

1) Clicking the button on your phone

2) Communicating via bluetooth

3) Locking your computer

 

Maybe try working on each part individually before trying to put the whole thing together into one.

75% of what I say is sarcastic

 

So is the rest probably

Link to comment
Share on other sites

Link to post
Share on other sites

15 hours ago, myselfolli said:

Maybe look at Xamarin? It allows you to develop an app for android in c#

 

And the way I see it, there's three main components to your project:

 

1) Clicking the button on your phone

2) Communicating via bluetooth

3) Locking your computer

 

Maybe try working on each part individually before trying to put the whole thing together into one.

I'll definitley try that, i have everything but the communicating via Bluetooth down but again thanks for the suggestion ?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×