Reputation: 1
I want to use run the sample code from the Android iBeacon Library but I am unsure how to add it. I have created some simple apps at this stage. Could someone please guide me to add the sample code for managing an iBeacon.
Terry
Upvotes: 0
Views: 1689
Reputation: 64916
First go through the Quick Start Guide for the Android iBeacon Library, choosing the right section based on whether you are using Eclipse or Android Studio. These steps cover how to download the library, link it with your existing project, and configure your AndroidManifest.xml
.
Once you do that, you can insert some of the sample code found here. The ranging sample code is the easiest to see in action. You can copy the full source code of an Activity
that does ranging by looking at the class here. If you copy that file into your project, remember to add an Activity
definition to your AndroidManifest.xml
.
Alternately, you can add ranging functionality to an exiting activity by copying all the methods in that example (and merge the contents of onCreate
) and then making your Activity
implement IBeaconConsumer
.
Upvotes: 1