{"id":18809629,"url":"https://github.com/smartfuturesg/medchecksdk_source_android","last_synced_at":"2026-01-10T09:30:15.236Z","repository":{"id":203077692,"uuid":"116767010","full_name":"smartfuturesg/MedCheckSDK_source_android","owner":"smartfuturesg","description":"MedCheck SDK With Example","archived":false,"fork":false,"pushed_at":"2018-12-04T13:31:50.000Z","size":2305,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-29T22:49:04.502Z","etag":null,"topics":["demo","medchecklib","medchecksdk"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartfuturesg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-01-09T04:46:41.000Z","updated_at":"2018-12-04T13:31:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"db3ecfd9-ec86-47e5-967f-fc77f0707ca3","html_url":"https://github.com/smartfuturesg/MedCheckSDK_source_android","commit_stats":null,"previous_names":["smartfuturesg/medchecksdk_source_android"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartfuturesg%2FMedCheckSDK_source_android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartfuturesg%2FMedCheckSDK_source_android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartfuturesg%2FMedCheckSDK_source_android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartfuturesg%2FMedCheckSDK_source_android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartfuturesg","download_url":"https://codeload.github.com/smartfuturesg/MedCheckSDK_source_android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239743602,"owners_count":19689521,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["demo","medchecklib","medchecksdk"],"created_at":"2024-11-07T23:17:07.871Z","updated_at":"2026-01-10T09:30:15.172Z","avatar_url":"https://github.com/smartfuturesg.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MedCheck SDK for Android\n\nA library that gives you power to access MedCheck Devices in your Android app.\n\n## Getting Started\n### Installation\n\nBelow are the two ways to integrate MedCheck Android SDK into your app.\n\n- **Option 1:** Add medchecklib as New Module To Your Project\n\n  If you want to modify lib files at the time of development, you have to integrate medchecklib as Android Library Module to your project. \n  \n  For that you have to clone the medchecklib present in current repositor and you can import it as Android Library in your project by following below steps:\n \n* Open your project in Android Studio.\n* Copy and paste the medchecklib folder to your Project folder.\n* On the root of your project directory create/modify the settings.gradle file. It should contain something like the following:\n```groovy\ninclude 'YourApp', 'medchecklib'\n```\n* gradle clean \u0026 build/close the project and reopen/re-import it.\n* Edit your app's build.gradle to add this in the \"depencies\" section:\n```groovy\ndependencies {\n//...\n    compile project(':medchecklib')\n}\n```\n\n**Option 2:** Compiling for yourself into AAR file and Adding only AAR file.\n\n  If you want to manually compile the SDK and also want to go through Example, begin by cloning the repository locally or retrieving the source code. Open the project in Android Studio and run the application:\n\nOutput file can be found in `medchecklib/build/outputs/` with extension .aar\n  \nYou can add that AAR file to your project by following below steps.\n  * Click File \u003e New \u003e New Module.\n  * Click Import .JAR/.AAR Package then click Next.\n  * Enter the location of the compiled AAR or JAR file then click Finish.\n  * On the root of your project directory create/modify the settings.gradle file. It should contain something like the         following:\n  ```groovy\n  include 'YourApp', 'medchecklib'\n  ```\n  * gradle clean \u0026 build/close the project and reopen/re-import it.\n  * Edit your app's build.gradle to add this in the \"depencies\" section:\n    ```groovy\n    dependencies {\n      //...\n      compile project(':medchecklib')\n    }\n    ```\n\n## Usage\n\nLibrary contains two App Components:\n\n* **MedCheckActivity** which can be extended by your activity as below:\n  ```groovy\n  public class MainActivity extends MedCheckActivity {\n  \n  @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        }\n  //.....\n  \n  }\n  ```\n  * **MedCheckFragment** which can be extended by your Fragment as below:\n  ```groovy\n  public class FirstFragment extends MedCheckFragment {\n  \n  @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        }\n  //.....\n  \n  }\n  ```\n  As per your requirement you can use above components.\n\nAfter extending you can implement all the parent class methods, which are mentioned below:\n\n ```groovy\n    protected void onPermissionGrantedAndBluetoothOn() {\n    }\n\n    protected void startScan() {\n    }\n\n    protected void onDeviceClearCommand(int state) {\n    }\n\n    private void onDeviceTimeSyncCommand(int state) {\n    }\n\n    protected void onDeviceScanResult(ScanResult scanResult) {\n    }\n\n    protected void onDeviceDataReadingStateChange(int state, String message) {\n    }\n\n    protected void onDeviceDataReceive(BluetoothDevice device, ArrayList\u003cIDeviceData\u003e deviceData, String jsonString, String     deviceType) {\n    }\n\n    protected void onDeviceConnectionStateChange(BleDevice bleDevice, int status) {\n    }\n ```\n## Important Methods\n\nApp component classes have three main methods which are essential for registering callbacks and checking favorable conditions before starting scan or any connection request, mentioned below:\n\n**requestLocationPermission()** This method is used to request location permission and handle bluetooth and GPS state and can be used as below:\n\n```groovy\n\n@Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        initViews();\n        requestLocationPermission();\n    }\n```\n\n**registerCallback();** This method is used to register callbacks in extended class coming from **MedCheck** Singleton Class and can be used as below:\n\n```groovy\n    @Override\n    protected void onResume() {\n        super.onResume();\n        registerCallback();\n    }\n```\n\n**checkAllConditions();** This method is used to check all the required conditions like GPS, Bluetooth and Location Permission before doing any scan or connection process which provides callback in **startScan()** if all conditions are satisfied and can be used as below:\n\n```groovy\n@Override\n    public void onClick(View view) {\n        switch (view.getId()) {\n        case R.id.btnStartScan:\n                checkAllConditions();\n                break;\n            default:\n                break;\n        }\n    }\n```\n\n## Powerful MedCheck.java Class\n\nTo perform the operations with Medcheck Devices we have a Singletone Class Medcheck.java which provides below methods:\n\n```groovy\npublic void startScan(Context context) {\n        MedCheckBluetoothLeService.startBluetoothLeScan(context.getApplicationContext());\n    }\n\n    public void stopScan(Context context) {\n        MedCheckBluetoothLeService.stopBluetoothLeScan(context.getApplicationContext());\n    }\n\n    public void disconnectDevice(Context context) {\n        MedCheckBluetoothLeService.disconnectBluetoothLeDevice(context.getApplicationContext());\n    }\n\n    public void connect(Context context, String mac) {\n        MedCheckBluetoothLeService.connectDeviceUsingMacAddress(context.getApplicationContext(), mac);\n    }\n\n    public void removeOnConnectionStateChangeListener() {\n        mCallback = null;\n    }\n\n    public void clearDevice(Context context, String mac) {\n        MedCheckBluetoothLeService.clearDeviceUsingMacAddress(context.getApplicationContext(), mac);\n    }\n\n    public void timeSyncDevice(Context context, String mac) {\n        MedCheckBluetoothLeService.timeSyncUsingMacAddress(context.getApplicationContext(), mac);\n    }\n\n    public void writeCommand(Context context, String mac) {\n        MedCheckBluetoothLeService.writeCharacteristicsUsingMac(context.getApplicationContext(), mac);\n    }\n```\nAll the above methods can be used as below mentioned:\n\n```groovy\n  MedCheck.getInstance().methodName();\n```\nFor example :\n\n```groovy\n  MedCheck.getInstance().startScan(mContext);\n```\n\n\n## Author\n\nsmartfuturesg, sumit@oursmartfuture.com\n\n## License\n\nMedCheckSDK is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartfuturesg%2Fmedchecksdk_source_android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartfuturesg%2Fmedchecksdk_source_android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartfuturesg%2Fmedchecksdk_source_android/lists"}