0

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

davidgyoung
  • 63,876
  • 14
  • 121
  • 204
  • 1
    Please tell what you've tried, whether you've found any documentation that you understand if there was any. – fejese Apr 16 '14 at 00:36

1 Answers1

1

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.

davidgyoung
  • 63,876
  • 14
  • 121
  • 204
  • I am not sure how to 'add an Activity definition to my AndroidManifest.xml'. Could you please show me how. – user3535702 Apr 17 '14 at 07:40
  • Knowing how to create new activities is one of several basic concepts that you must know to build an Android app. I would read a tutorial (online or in print) to get the fundamentals down first. That said, an answer to a similar question is here: http://stackoverflow.com/questions/3832619/add-a-new-activity-to-the-androidmanifest – davidgyoung Apr 17 '14 at 12:08
  • Hi, @davidgyoung None of the links for sample code work! – santobedi Jul 24 '18 at 02:11
  • Hi, @santobei, please create a new question with specific info about the sample you are trying, exactly how you are using it, and what happens that is different than what you expect. – davidgyoung Jul 24 '18 at 12:49