• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Bluetooth serversocket in background

 
Ranch Hand
Posts: 41
MySQL Database Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have made a game where you navigate a map and have to find an object. It is a very simple sprite game and now I want to now make it so that two players will communicate with each other so they can effectively race against each other.

The idea is to make one of the phones the "Server" and the other devices (as may make it for 3-4 players to play against each other) will connect to it and then when they have got the "item" send the time it took to complete to the server.

This will then wait for the others to complete the game and the collect the times. My question is how do I best run the bluetooth server socket in the background of the "Server" phone which will want to play the game as well as being responsible for collecting all the data.

I have read that using a service would be a good idea but I have never made one so not sure how communication between and activity and service would work.

Many Thanks
Matt
 
He was expelled for perverse baking experiments. This tiny ad is a model student:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic