سؤال

لدي جدول ترقية من 2.3.3 إلى 4.0.انها تعمل بشكل جيد. الآن، قمت بتثبيت تطبيق اختبار ADB من نموذج التعليمات البرمجية. لكنها لا تظهر أي شيء.شاشة سوداء فقط موجودة عندما أتحمل الماوس أو لوحة المفاتيح USB.Mouse ولوحة المفاتيح بشكل جيد ولكن تطبيق اختبار ADB لا تظهر أي شيء.

كيف يمكنني اختبار ذلك هناك API ملحق USB موجود في الجهاز اللوحي؟ هل يمكن لأي شخص تقديم رمز عينة لذلك

شكرا لك.

هل كانت مفيدة؟

المحلول

Upgrading the Android device from 2.3.3 to 4.0 may not enough to make sure that it will support accessory mode required by ADK. Check the kernel version of the ROM. If it below 2.6.., then most probably it does not support the accessory mode.

نصائح أخرى

Try this, taken from http://developer.android.com/guide/topics/usb/accessory.html

UsbAccessory mAccessory;
ParcelFileDescriptor mFileDescriptor;
FileInputStream mInputStream;
FileOutputStream mOutputStream;

...

private void openAccessory() {
    Log.d(TAG, "openAccessory: " + accessory);
    mFileDescriptor = mUsbManager.openAccessory(mAccessory);
    if (mFileDescriptor != null) {
        FileDescriptor fd = mFileDescriptor.getFileDescriptor();
        mInputStream = new FileInputStream(fd);
        mOutputStream = new FileOutputStream(fd);
        Thread thread = new Thread(null, this, "AccessoryThread");
        thread.start();
    }
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top