We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am following the following tutorial(http://arduinobasics.blogspot.in/2013/03/bluetooth-android-processing-1.html)
I am having problem at this point of the code:
if (!bluetooth.isEnabled()) {
Intent requestBluetooth = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(requestBluetooth, 0);
}
It says "The function "startActivityForResult(Intent,int)" does not exist"
Answers
@Aarkay_Jain===
are you using processing 3.XXX? - If so, you are in a fragment, not in an activity and you must call the activity which created the fragment.
Yes I'm using 3.xxx, please define fragment and elaborate the process(I'm a newbie!).
@Aarkay_Jain===
see here:
https://developer.android.com/guide/components/fragments.html
Can you share a tutorial on using fragments and activity for processing-android mode?.
It's great that you've shared the problem. Id like the solution too. please explain how to "call the activity which created the function". Thank you.
@Aaekay_Jain===
this.getActivity()...for calling your activity.
@akenaton \n what is best for bluetooth and wifi and stuff related apps? processing or any other like Android studio?
@Aarkay_Jain===
For this kind of things - and all those which are not mainly graphics or which are bases upon phones specs (contacts, sensor, geoloc...) p5 is not the best solution (AS or Eclipse are far better) but you have to know or learn android classes...