I'm working with libgdx and OpenCV in my Android Stuio Project. but AndroidApplicationConfiguration are not resolving. These libraries are not being resolved. in my build.gradle I've used these version of libraries:

implementation "com.badlogicgames.gdx:gdx:0.9.9"
    implementation "com.badlogicgames.gdx:gdx-box2d:0.9.9"
    implementation "com.badlogicgames.gdx:gdx-freetype:0.9.9"

Code:

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //load preferences
        mPreferences = new UserPreferences(this);
        GridSize mGridSize = new GridSize(mPreferences.getLat(), mPreferences.getLon());
        mSettingsControl.setGridSize(mGridSize);
        mCameraControl = new CameraSurface(this, mSettingsControl);
        //getting camera surface view
        SurfaceView mSurfaceView = mCameraControl.getSurface();
        FrameLayout layout = new FrameLayout(getContext());
        //crating main view from activity_main layout
        View mainView = LayoutInflater.from(getContext()).inflate(R.layout.activity_main, layout, false);
        // setting up sensors
        orientationProvider = new ImprovedOrientationSensor2Provider(this, (SensorManager) getContext().getSystemService(SENSOR_SERVICE));
        //creating and configuring new instance of LibGDX spherical view
        AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
        cfg.useGyroscope = true;
        cfg.useAccelerometer = false;
        cfg.useCompass = false;
        cfg.r = 8;
        cfg.g = 8;
        cfg.b = 8;
        cfg.a = 8;
        AndroidCamera androidCamera = new AndroidCamera(rotationVector, mCameraControl.getSphereControl(), mSettingsControl);
        mManualControl = androidCamera;
        //initializing LibGDX spherical view
        initializeForView(androidCamera, cfg);
        if (graphics.getView() instanceof GLSurfaceView) {
            LOG.s(TAG, "creating layout");
            GLSurfaceView glView = (GLSurfaceView) graphics.getView();
            glView.setZOrderMediaOverlay(true);
            glView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
            glView.setKeepScreenOn(true);
            layout.addView(mSurfaceView);
            layout.addView(glView);
            layout.addView(mainView);
        }
        //attach layout to view
        setContentView(layout);
        //injecting view components
        ButterKnife.bind(this);
        NavigationView navigationView = findViewById(R.id.nav_view);
        navigationView.setNavigationItemSelectedListener(this);
        //delete files from temporary picture folder
        ImageRW.deleteTempFiles();
        ImageRW.deletePartFiles();

        mPicturePosition = PicturePosition.getInstance(mGridSize.getLAT(), mGridSize.getLON(), true);

        imageHandler = new Thread(new Runnable() {
            public synchronized void run() {
                LOG.s(TAG, "image handler call");
                while (mRunning) {
                    try {
                        wait(500);
                    } catch (InterruptedException ex) {
                        ex.printStackTrace();
                    }
                    List<Integer> newImagePart = ImagePicker.loadPanoParts(mPicturePosition);
                    if (newImagePart.size() == 3) {
                        Message message = new Message();
                        message.what = PROCESS_PART_IMAGES;
                        mPicturePosition.markAsUsed(newImagePart);
                        Bundle data = new Bundle();
                        int id = imageCount++;
                        message.arg1 = id;
                        data.putIntegerArrayList(PART + id, (ArrayList<Integer>) newImagePart);
                        message.setData(data);
                        threadHandler.sendMessage(message);
                    }
                }
            }
        });
    }

Related posts

Recent Viewed