开发者

Android Bluetooth API: Can a servar side app Connect to well known client only on a bluetooth connection

开发者 https://www.devze.com 2023-03-01 19:19 出处:网络
May i achieve that server side application (using android bluetooth API)connect to particular client if i already know client\'s device name (as saved at servar side app in its database)? How would i

May i achieve that server side application (using android bluetooth API)connect to particular client if i already know client's device name (as saved at servar side app in its database)? How would i handle it? some idea /Code example?

i am making class survey app for android devices using bluetooth ( i am using bluetooth chat example given by android developers) where one device behaves as server (an app for teacher) and all other devices behaves as clients (an app for students) and connect to server and download the quiz.Solve it and get the result back. i have done this part. but i need to know how can i assure that authentication on bluetooth, i mean only well known devices (clients) as saved in my database (at servar side app) can connect to my servar side app and all other clients are ignored and can't distrub the system(because a student might have my client side app and can connect 开发者_如何转开发easily but the student is not well known by the app as saved in my database). it is important for my app as i want that only particular group of students can access/connect to server side app. All others are ignored. A code example would be nice . i would really appreciate your time


In standard Android installs (i.e. not in a custom ROM) you can only connect between 2 paired devices. If a student's device is not paired with the teacher's device no connection will be possible.

If a student's device IS paired with a teacher's device already but the student shouldn't be connecting you will need to do the access control yourself using either the Bluetooth MAC address or device name: you probably want to use the MAC address, given that the name can be trivially changed but the MAC address is MUCH harder to change.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号