I have a simple application that has a button that allows the user to enter the camera application by clicking it. It seems that things work fine if I were to take a picture having the tablet in landscape mode. It prompts the user to save or discard. After clicking save, it returns to my application.
However, when I attempted to capture a photo with a portrait mode, after clicking the save button, it will return to the camera application again.
Why is this so?
It has nothing to do with your application. By firing intent you are invoking camera application present on your device. Its behaviour out of your reach
Related
about android capture.
The function of the application is that when you press a specific button,
One overlay button located at the top of the home screen of the device is generated.
When I press the overlay button, I want to capture the screen of the device I'm currently viewing, not the application screen.
I want to capture the top screen, but only the activity done by the application is captured.
How should I capture the screen I'm currently viewing?
I tried researching this problem for days before but I do not think that it is possible. Then I have an idea that instead of try to screen shot "outside" of app, we can use Service to keep our app alive, make back ground transparent and detect screenshot action of device. You may want to try com.abangfadli.shotwatch
I want the App to have predefined gestures like: goOnline(); that opens WhatsApp,
then click on the first chat, read the message and reply with a Dialogflow Interaction.
Yet, i did find something about WhatsApp not having an API and not letting it do things with it Programmatically, so i want to have an app that runs in the background or the foreground, that just controls the phone itself with gestures that do that for me.
Phone battery or having the screen on forever isn't a Problem. It will always be On and Charging.
For example, goOnline(); just draws upwards from the bottom, opening the App Drawer.
Then it clicks on the App that is pre-defined with coordinates, then opens the first chat, once again, with coordinates. Then click on the bottom chat field so the keyboard opens, write something random (Dialogflow) Then answer by pressing the enter key to and then go back to the Chat overview (pressing the back button at the top left) Close WhatsApp again by pressing the home button at the bottom.
Now my actual question and tl;dr:
Can i make scripted paths like swiping and clicking in Android Studio with coordinates and build them into functions?
I hope someone can help.
I need some help adding a button, that will start the camera and then the captured image gets uploaded to my server.
the app already functions for browsing the gallery selecting a file adn uploading
I tried several answers from around the internet and none have worked.
The button is aded to the layout editor
I just need the code to start the camera
If you wish to start default camera app and just get the result when user navigates back, then i suggest to use camera intent with ACTION_IMAGE_CAPTURE: https://developer.android.com/training/camera/photobasics#TaskCaptureIntent
I want to develop a custom launcher android for Samsung Tablet where user can only exit the launcher with a passcode input.
Currently I face problem in recent app button. If user click recent app button, and then click the recent app, then click backpressed, device will go to TouchWiz launcher even I already set my launcher as a default launcher. Also, I disable the notification bar so user can't access it. However, when it go to TouchWiz via backpressed at recent app, the notification also disable, it should be able when in TouchWiz launcher.
My proposed solution is to detect when user click recent app and forbid any action that can cause the changes of current view.
You can check onWindowFocusChanged method. You Activity will get a callback on this method when you click recent apps or press back button from it. When you click on recent apps hasFocus will be false and when you press back it will be true.
documentation
I can't detect the recent app clicked. So I use onPause() to detect if my app is on foreground or background. If is in onPause() then my app is on background, if so, I do startActivity(myLauncher) so other app won't launched.
I'm using the first method outlined in this answer (https://stackoverflow.com/a/10229228) to invoke the camera app to let the user take a photo and return it to my app. What I want to do is get a series of photos from continuous (burst) shot mode, but invoking the camera app in this way only allows the user to take a single photo.
I have tried adding code to my app to use the camera directly with autofocus set to infinity however it doesn't get anywhere near the performance of continuous shot mode.
Is there something I can add to the intent I'm starting to tell it to use a different mode?