AppyBuilder
  • AppyBuilder Introduction
  • Release Notes
  • Terms of Service
  • AppyBuilder Editors
    • Design Editor
    • Blocks Editor
    • Components
  • Live Testing
  • Components
    • Reference
      • User Interface
        • Button
        • Checkbox
        • Chronometer
        • DatePicker
        • FloatingButton
        • GalleryViewer
        • GridView
        • Image
        • Label
        • ListPicker
        • ListPickerCustom
        • ListView
        • ListViewCustom
        • Notifier
        • PasswordTextBox
        • ProgressBar
        • RatingBar
        • Slider
        • Spinner
        • Switch
        • TextBox
        • Toggler
        • WebViewer
        • TimePicker
        • LinedTextBox
      • Effects
        • Decoration
        • Sidebar
        • Snackbar
      • Layout
        • Horizontal Arrangement
        • Horizontal Scroll Arrangement
        • Table Arrangement
        • Vertical Arrangement
        • Vertical Scroll Arrangement
      • Drawing and Animation
        • Ball
        • Canvas
        • Image Sprite
      • Maps
        • Circle
        • FeatureCollection
        • LineString
        • Map
        • Marker
        • Polygon
        • Rectangle
      • Media
        • Camcorder
        • Camera
        • ImagePicker
        • Player
        • Sound
        • SoundRecorder
        • SpeechRecognizer
        • TextToSpeech
        • VideoPlayer
        • YandexTranslate
      • Connectivity
        • ActivityStarter
        • BluetoothClient
        • NetworkManager
        • Web
        • WiFiManager
      • LegoMindStorms
        • Ev3ColorSensor
        • Ev3Commands
        • Ev3GyroSensor
        • Ev3Motors
        • Ev3Sound
        • Ev3TouchSensor
        • Ev3UI
        • Ev3UltraSonicSensor
        • NxtDirectCommands
        • NxtDrive
        • NxtLightSensor
        • NxtTouchSensor
        • Ev3ColorSensor
      • Storage
        • Airtable
        • File
        • FirebaseDB
        • FTPManager
        • FusionTableControl
        • TinyDB
        • TinyWebDB
      • Sensors
        • Accelerometersensor
        • BarcodeScanner
        • BatteryManager
        • Clock
        • Gyroscopesensor
        • LightSensor
        • LocationSensor
        • MagneticFieldSensor
        • MemoryInfo
        • NearField
        • OrientationSensor
        • Pedometer
        • ProximitySensor
        • PressureSensor
        • SoundSensor
        • TemperatureSensor
        • ProximitySensor
      • Social
        • ContactPicker
        • EmailPicker
        • PhoneCall
        • PhoneNumberPicker
        • Sharing
        • Texting
        • Twitter
      • Experimental
        • CloudDB
      • Visualization
        • GoogleMap
        • XYChart
      • Advanced
        • KitchenSink
        • OneSignalPush
        • PushNotification
        • SQLite
      • Monetize
        • AdAmazon
        • AdAmazonInterstitial
        • AdMob
        • AdMobInterstitial
        • AdMobRewardedVideo
        • InAppBilling
        • MMediaInterstitial
  • Tutorials
    • Openstreet Map
    • OneSignalPush
    • Creating E-book
    • Basic
      • Simulating Progress Bar
      • Creating Splash Screen
      • Adding Privacy Policy
      • Package Name
      • Beginner - Talk to Me app
      • Beginner Tutorial
    • Animation
      • Animation & Collision Part I
      • Animation & Collision Part II
    • Monetization
      • AdMob Banner
      • AdMob Interstitial
      • AdMob Rewarded Video
      • Increasing Monetization Revenue
    • Using RadioButtons
    • keystore
    • Firebase - Advanced
  • Extensions
  • Concept Cards
    • Bouncing Sprites
    • Sprite Timed Movement
    • Sprite Movement on Timer
    • Adding Sound
    • Speech Recognition
    • Random Numbers
    • Fling Movement
    • Movement with Sensors
    • Drawing on Canvas
    • Multiple Screens
    • Creating Custom Colors
    • Movement with Buttons
    • Shaking Phone
    • Collision Detection
    • Dragging A Sprite
  • Advanced
    • Source File Structure
  • Code Editor
Powered by GitBook
On this page
  • Properties
  • Available
  • Enabled
  • KeepRunningWhenOnPause
  • Distance
  • MaximumRange
  • Events
  • ProximityChanged(number distance)
  1. Components
  2. Reference
  3. Sensors

ProximitySensor

A sensor component that can measure the proximity of an object (in cm) relative to the view screen of a device. This sensor is typically used to determine whether a handset is being held up to a persons ear; i.e. lets you determine how far away an object is from a device. Many devices return the absolute distance, in cm, but some return only near and far values. In this case, the sensor usually reports its maximum range value in the far state and a lesser value in the near state. It reports the following value:

Distance: The distance from the object to the device

Properties

Available

Reports whether or not the device has a proximity sensor

Enabled

If enabled, then device will listen for changes in proximity

KeepRunningWhenOnPause

If set to true, it will keep sensing for proximity changes even when the app is not visible

Distance

Returns the distance from the object to the device

MaximumRange

Reports the Maximum Range of the device's ProximitySensor.

Events

ProximityChanged(number distance)

Called when distance (in cm) of the object to the device changes.

PreviousPedometerNextPressureSensor

Last updated 7 years ago