gabrouze Posted May 20, 2010 Share Posted May 20, 2010 Bonjour, J'ai ecris une application qui utilise le Bluetooth pour android 1.5. Tout fonctionne parfaitement sur android 1.6, par contre avec l'arrivée du 2.0, il y a les classes BlueTooth qui apparaissent et l'ancien code ne fonctionne plus et donne un nullPointer : mDevice = mContext.getSystemService("bluetooth"); Je veux que ceux qui utilisent 1.5 et 1.6 puissent continuer a utiliser mon prog donc la compilation se fait avec la lib 1.5 et donc je n'ai acces a ces nouvelles classe Bluetooth (revision 5). Quelqu'un a t il une solution ? Quote Link to comment Share on other sites More sharing options...
Sylvain-a Posted May 20, 2010 Share Posted May 20, 2010 Salut, en cherchant un peu t'aurais trouvé... ce topic donne la réponse et est situé 2 topics en dessous du tiens... https://forum.frandroid.com/forum/viewtopic.php?id=4899 :) Quote Link to comment Share on other sites More sharing options...
gabrouze Posted May 20, 2010 Author Share Posted May 20, 2010 Oui je l'ai vu et j'ai essayé mais la réponse finale ne sert qu'a faire fonctionner sur android 1.x. Le meme code ne fonctione pas sur 2.x / j'ai le message suivant : 05-20 11:20:57.515: ERROR/AndroidRuntime(30020): Uncaught handler: thread main exiting due to uncaught exception05-20 11:20:57.525: ERROR/AndroidRuntime(30020): java.lang.NoClassDefFoundError: android.bluetooth.IBluetoothDevice 05-20 11:20:57.525: ERROR/AndroidRuntime(30020): at backport.android.bluetooth.IBluetoothDeviceLocator.get(IBluetoothDeviceLocator.java:41) 05-20 11:20:57.525: ERROR/AndroidRuntime(30020): at backport.android.bluetooth.BluetoothAdapter.getDefaultAdapter(BluetoothAdapter.java:405) Quote Link to comment Share on other sites More sharing options...
Sylvain-a Posted May 20, 2010 Share Posted May 20, 2010 Ah, autant pour moi :). j'avais cru comprendre qu'android utilisait automatiquement le fichier non backporté ^^ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.