Set pass code for an android application in android studio - java

I am working on a application , it is having an pass code screen with 4 digits. How to set pass code like that screen and when I open the app I need to show the pass code screen in order to open the application.
Thank you.

first you need to google out something before you ask any question..any way this may help you JUST START your THOUGHT.
How can i set up screen lock with a password programmatically?

Related

How to show dialog when app is in background in android app like collect app

image
I am sharing a link from another app like youtube to my app but Now it opens my app and then saves the link. My need is to not save the link without opening the app
There are two solutions:
You don't need dialog or anything like it. Just make the activity fully transparent, process data and finish it. Optionally, you can show Toast as a feedback. It would look and feel like everything is processed in the background.
You need dialog or some kind of UI. For this, you can use floating windows that you can show over other apps. Many apps use this approach such as Pocket, etc. There is complete guide on how to do it: https://localazy.com/blog/floating-windows-on-android-1-jetpack-compose-room

Can I start Android App not in FullScreen mode?

I saw that youtube app can minimize to small window that displays over all other windows.
I want to do the same with my app.
What strings in manifest (or any other string) do it?
Thanks,
I am about this:
Take a look at google documentation about this topic, it is called picture-in-picture
You need to add the first two lines to your activity which will handle Picture in Picture (PIP) mode.
The third line needs to be added so that your activity will not relaunch once layout changes occur, such as device screen rotation.
android:resizeableActivity="true"
android:supportsPictureInPicture="true"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
You can find more information about this in the android documentation.
Here is a tutorial on how to implement it.
You can refer to the following tutorials which are nice to understand
picture in picture feature
https://medium.com/#mujtahidah/making-picture-in-picture-android-4120ac73efb4
http://www.zoftino.com/android-picture-in-picture-mode-example

How to check if specific external app is used in foreground

I am building an app which runs in the background and I want to display a short text but only when for example the user is checking images on Instagram. So I need to check if Instagram is in use and then put the message in some kind of if statement.
How do I check if a specific app is currently used in the foreground? I searched around but can only find old posts with codes that are not supported anymore.
I am new to building apps so can someone please explain me how to accomplish this?

Can i insert a some code in HTML to set android wallpaper

This would be my first post ever on stackoverflow.com
I have found many many of the answers to my questions but this one question i cannot figure out.
I know that it is possible to invoke few android commands via either java code or other html code and was wondering if it is possible for a my website to set an image on my site as their wallpaper on their android phone.
To better explain this is what im doing.
My website will have say for example 50 images of something and when the user clicks on one of those photos the website will ( if possible ) invoke the android " set as background " Process.
Currently it is set to just download to their phone and then the user goes and selects the photo as their wallpaper from their download folder on their phone.
Thank You in advance
Vick S.
Interesting question. In Android, java runtime environment is what being run inside OS, and in order to execute commands you wish to make, rooting to OS is only way, and this can be done in java. So, if I were in your shoes, I'd drop the idea of rooting command line to android via HTML - but look over onto java side.
In other words...yes, it is possible. But, end-users will already have their phone/mobile pre-set to guard against that rooting commands, but to ask for permission from owner. If owner clicked yes, then you are in game. The hardest part about this is the complexity requiring bunches of efforts to code such rooting functions.
But, this could something as a starting point, at least? Running Shell commands though java code on Android?
Good luck!

System overlay android 4.0

Before android 4.0 you could create and overlay over any app with TYPE_SYSTEM_OVERLAY and get touches with FLAG_WATCH_OUTSIDE_TOUCH... Now with android 4 you cant receive the touches.
basically the idea follows this app,
http://www.appbrain.com/app/smart-taskbar-%28sidebar%29/com.smart.taskbar
You can keep your app open, or always on top. it will run over any app.
Ive looked every where for information and even source code for the use on android 4.0 but no luck... Now.. I know for certain there are apps that still do this even on 4.0... there is still a way. Any ideas?
I found a full sample app here that works for Android 4.0
Here is the highlight:
To create an overlay view, when setting up the LayoutParams DON'T
set the type to TYPE_SYSTEM_OVERLAY.
Instead set it to TYPE_PHONE.
Use the following flags:
FLAG_NOT_TOUCH_MODAL
FLAG_WATCH_OUTSIDE_TOUCH
FLAG_NOT_TOUCH_MODAL << This one is quite important. Without it, focus is given to the overlay and soft-key (home, menu,
etc.) presses are not passed to the activity below.
Also make sure you add the SYSTEM_ALERT_WINDOW permission to the
mainifest file.

Categories