How to invoke front camera intent while building an android apk in Android O Build, (Android 8.0) - android-camera

I am building an Android app which requires an intent to invoke front facing camera when device is lifted to certain height to take selfie. I am working on Android O (Android 8.0). So Please suggest me an easy way to invoke the front camera. I referred old codes but none of them were related to Android O.
Here is the code I've tried so far:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra("android.intent.extras.CAMERA_FACING", android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT);
intent.putExtra("android.intent.extras.LENS_FACING_FRONT", 1);
intent.putExtra("android.intent.extra.USE_FRONT_CAMERA", true);
startActivityForResult(intent, REQUEST_CODE);

I am building an Android app which requires an intent to invoke front facing camera when device is lifted to certain height to take selfie.
Use the camera APIs (android.hardware.Camera or android.hardware.camera2.*). Or, use a library that wraps around them and makes their use easier, such as Fotoapparat or CameraKit-Android.
I referred old codes but none of them were related to Android O.
There is nothing about your problem that has anything to do with Android 8.0.

Related

can i create android and ios applications with flutter without android emulator , with just flutter sdk and vscode and browser

I learned dart and I want to access flutter, but I was surprised by android studio because my computer is weak.so,can i create android and apple applications with flutter without android emulator , with just flutter pack and vs code and browser
If you only work with simple UI widgets yes you can use the embedded development tools within the browser to get the dimensions of the device you working on like so
But, most of the cases there are libraries work differently according to the platform so it might work with the web but not with android or iphone and you can not test it without the actual device.
And yes VS code is a very good with flutter and might be better than android studio but it won`t make the difference you expected, in my opinion what make it faster is to use an actual device for testing and not using the emulator, also don't use a lot of application along side with the IDE, like if you are using spotify, listening to youtube video or following a tutorial just use your phone because browsers as bad as emulator.
You can use a text editor and the command line tools to build flutter apps and test them on a real device.
I wouldn't recommend it though.
You could give VSCode a try as it is a more lightweight environment.
Your computer should handle testing on a real device, which requires only a USB cable. Accessing the application in the browser would probably eat a lot more memory. You can read about how to use the real device with flutter here.

Android Launch screen take more time than a native one for Flutter

I'm new to Flutter, and I noticed that the launch screen for Android take more time than usual for a native app, I followed the instructions here
But for IOS, everything is working fine.
Is there a way to make the launch time for Android faster?
Thanks!
Flutter is a Cross Platform. When ever you to compare with Native then it always slower than Native Apps. Both Android and IOS handling and Behaviour are different so that why you got different for Lunching time..

Using IOS device to develop an Android game

as the title described my issue , my question seems to be dumb a little ; But because I don't own an Android device , But I published Android Apps using Genymotion Emulators. And I tried to download Unity Remote App on my Emulator but it does not work that well.
So my question here is : Can I use my iPhone device to test and develop the game that will be published to android users?
Yes, it is possible to do that since the Input methods being touches do not differ. The only thing you have to keep in mind is the wide range of resolutions used by android devices.
You can use can use your iphone for testing but jusst for the logic. The performance and resolutions are very different for android. Also if there is any platform specefic code you have written in unity then you have to take care of that.
Besides using your iPhone you can generate an APK from unity and install it on the android emulators to test.

Android Wear : InsetActivity

I'm learning Android Wear and I'm confused with the Android Wear.
When I create the UI with a watchViewStub it works as expected. When I extend InsetActivity there is no library that knows this kind of object.
Checking on Android web site, there is no mention of InsetActivity.
So, where is the mistake? Is it an object that was on pre release and then not used by Android Wear, do I have to use a special library?
InsetActivity is part of the wearable support library.
Ensure you have added the following dependency in your wear build.gradle.
compile 'com.google.android.support:wearable:+'

Run Phonegap application, that supports HTML5 and Javascript on Android Wear

I had already executed Hello World apk on Android wear emulator, now I want to use HTML inside asset folder to execute it in wear emulator but I am not getting any success
Android wear supports only Java application not to render HTML document. Please refer to https://developer.android.com/training/building-wearables.html for Android were app in details.
It does not work like you are used to from normal Phonegap/Cordova yet. But as you can use a full Chrome Browser on the watch (like com.appfour.wearbrowser) I think it can be done!
So what you need to do is fork Chrome on Android Wear and let it launch your website...
For simple HTML, our Android HTML software renderer should work, see https://github.com/kobjects/htmlview