package Ġcom . sil icon labs . ble demo . MainMenu . Menu Items . Demo Ċ Ċ import Ġandroid . bluetooth . Bluetooth Adapter Ċ import Ġandroid . content . Context Ċ import Ġandroid . util . Pair Ċ import Ġandroid . widget . Toast Ċ import Ġcom . sil icon labs . ble demo . Base . Select Device Dialog Ċ import Ġcom . sil icon labs . ble demo . Bluetooth . Services . Bluetooth Service Ċ import Ġcom . sil icon labs . ble demo . MainMenu . Activities . MainMenu Activity Ċ import Ġcom . sil icon labs . ble demo . MainMenu . Menu Items . Main MenuItem Ċ import Ġcom . sil icon labs . ble demo . R Ċ Ċ class ĠHealth Th er mo meter ( image Res Id : ĠInt , Ġtitle : ĠString , Ġdescription : ĠString ) Ġ: ĠMain MenuItem ( image Res Id , Ġtitle , Ġdescription ) Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġpermission Granted ( context : ĠContext ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġconnect Type Ġ= ĠBluetooth Service . Gatt Connect Type . THER MO METER ĊĠĠĠĠĠĠĠ Ġval Ġprofiles Info Ġ= ĠlistOf ( Pair ( R . string . ht p _ title , ĠR . string . ht p _ id )) ĊĠĠĠĠĠĠĠ Ġval Ġselect Device Dialog Ġ= ĠSelect Device Dialog . new Dialog ( R . string . title _ Health _ Th er mo meter , ĠR . string . main _ menu _ description _ ther mo meter , Ġprofiles Info , Ġconnect Type ) ĊĠĠĠĠĠĠĠ Ġselect Device Dialog . show (( context Ġas ĠMain Menu Activity ). support FragmentManager , Ġ" select _ device _ tag ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġpermission Denied ( context : ĠContext ) Ġ{ ĊĠĠĠĠĠĠĠ ĠToast . makeText ( context , Ġcontext . getString ( R . string . toast _ bluetooth _ not _ enabled ), ĠToast . LENGTH _ SHORT ). show () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġcheck Permission ( context : ĠContext ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠBluetooth Adapter . getDefault Adapter (). isEnabled ĊĠĠĠ Ġ} Ċ Ċ }