I am attempting to enable Bluetooth on an Android device. I have read to Android documentation and have a pretty good idea of what the process is. I am, however, rather stuck at actually firing off an Activity using the manifest file. This is what I've done so far...
I've developed an Android Module with a couple of classes:
In BluetoothSetup, the onCreate method looks like:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
connectBluetooth();
}
Also in BluetoothSetup, the connectBluetooth() method looks like:
protected void connectBluetooth(){
// if statements to check if bluetooth is enabled/avail removed
Intent intentBluetooth = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(intentBluetooth, 0);
}
}
Finally, in the module's timodule.xml I've added:
<activity android:label="@string/app_name" android:name="com.eyesore.bluetooth2.BluetoothSetup">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
The module compiles just fine, but does not actually do anything. I fear that I've missed a fundamental step here, but I'm just not sure what it is. Any advice would be greatly appreciated!
Figured this out. Wound up creating a custom per instructions here:
https://wiki.appcelerator.org/display/guides/Maintaining+a+Custom+AndroidManifest.xml
I removed the extra code Titanium drops in the manifest file and it seems to be working.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With