Transparent activity that really clear other Activities - android

I have a small android machine that has android and other native process at same time.
Because the graphic of native is below, android app should be transparent.
I read many sources, made transparent activity and it works.
But it is special app for my machine, thus it should act like Launcher.
The thing is... if I back to my app after launch another app, the screen still shows another app's image.
Ex: My app(Home) - Other non-transparent app - (back/home) - My app shows previous other app's image, because my app is transparent.
So I want to make my app to clear all screens and be transparent to show native's graphic. I don't mean finish others. I want to clear or turn off visibility of other apps only.
FYI, I can't wrap the native to android app with JNI. The native process is old and big legacy. :(
Thanks in advance.

Have a look at FLAG_SHOW_WALLPAPER. Setting that to your activity will make it seem like all other apps were closed/hidden:
http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SHOW_WALLPAPER

Related

How to go about making a global bottom sheet in Android OS

I am customizing an NXP based Android 10 BSP on an iMX8 platform and I'm trying to make a custom swipe up bottom sheet that's global to the OS like the status/notifications bar on a swipe down gesture.
I've followed this thread here but customized the swipe up layout to have a list of applications available on the OS (basically a launcher within an app).
While this feature works great within my app, I actually want that slide up layout to be global so that I can launch applications no matter which card/application I'm currently on.
How would I go about doing this since this feature is limited to my main app? Would it be possible to add this to SystemUI?
Yes technically, you can do something like the existing NotificationBar that you can drag from the top of the screen. In your case you'd do from the bottom.
The logic for NotificationPanelView is in SystemUI package.
But beware, the existing logic there is a bit spaghetti code, so it could take a while to understand in order to add your own panel.
Another option for you would be to have your panel as an overlay view on top of everything ( drawn from a background service from your app ). See this answer for some initial guidance.
You'd show at first a transparent view, that receives all inputs. If you detect the gesture, you 'move up' the sheet from the bottom, otherwise you pass the input to apps below.
Note that this:
Would mean your service needs to be a foreground service, so its not killed.
If your app is killed from Settings, the BottomSheet will go away as well.
You cannot show this over the Settings app ( intentional Android limitation)
To recap:
The SystemUI solution would be better long term, less limitations... but more difficult to develop initially.
The App overlay solution is easy to implement, but has several limitations which can be a dealbreaker.

How to change default Nativescript opening page in Angular+Nativescript application?

I am working on the Nativescript+Angular application and I am done with my assignment but now I want to change the default opening page image of NativeScript app.
I have tried but unable to find that. Please let me know if anyone knows.
Please see the image. I want to change this image.
NativeScript Sidekick makes changing assets like this for iOS and Android a breeze.It will help you by generating assets like the splash screen or app icon from a single image for all the different required resolutions.
https://www.nativescript.org/nativescript-sidekick
What you see upon launch is called Launch Screen or Splash Screen.
The default configuration allows you to showcase a static image upon launch, you may update the images for iOS at App_Resources/iOS/Assets.xcassets Or Android at App_Resources/Android/src/main/res/drawable-***/background.png
On iOS, you may design your own customised launch screen if you are familiar with Storyboard, the default story board file may be located atApp_Resources/iOS/Assets.xcassets/LaunchScreen.storyboard.
If you like some sort of animation upon launch screen, checkout nativescript-splashscreen plugin.

Android, how to make a Splash Screen aka Launch Screen without the white screen?

As many other Android developers, I'm not a huge fan of splash screens, but still most customers want them because iPhone has them or some other "great" reason.
In the android guidelines it says:
Naturally, you want everyone to quickly learn the ropes, discover the cool features, and get the most out of your app. So you might be tempted to present a one-time introductory slideshow, video, or splash screen to all new users when they first open the app. Or you might be drawn to the idea of displaying helpful text bubbles or dialogs when users interact with certain features for the first time.
Link here, first paragraph in "Don't show unsolicited help, except in very limited cases"
And now in the material design guidelines they recommend developers to use a "Launch Screen"
Because launching your app while displaying a blank canvas increases its perceived loading time, consider using a placeholder UI or a branded launch screen.
I'm guessing the android website hasn't been updated yet. Anyway, the last version of Hangouts (5.0.104...) has a very nice and quick Launch Screen. Its displayed instantly on my Nexus 5 with Marshmallow. So my question, is there an "official" way of doing this?
I've been searching for examples but can't find anything except for kind of workarounds like this example here which uses what I think is the most common approach with a Splash Screen Activity. This, however, shows a white screen when the app has been destroyed before your actual splash screen is shown.
This second example uses a theme with a window background which is shown instantly but disappears almost equally quick.
So, how does Google make the Launch screen like in Google Hangouts which is shown without delay and without any white screen before?
A colleague from my work have been in a material design training at Google HQ in London and their official way of doing it is using the windowBackground in the theme as you posted on your own question: http://antonioleiva.com/branded-launch-screen/
The idea is that the XML theme gets show very very fast by the framework, and as soon as your actual layout is loaded it will be visible.
The difference between Hangouts or even Google Maps, is that their layout is a very heavy/complex layout and they simply take longer to load than a HelloWorld app.
As your app grows and gets more complex and with more elements being initialized during Application.onCreate or Activity.onCreate, your slash screen will also be visible for longer time.
edit:
I've found a Google+ post from the official "Android Developers" profile and repost from Google engineer Ian Lake saying the same thing:
https://plus.google.com/+AndroidDevelopers/posts/Z1Wwainpjhd
https://plus.google.com/+IanLake/posts/SW7F2CJvAmU
It's because the first solution (http://antonioleiva.com/branded-launch-screen/) is changing the theme in onCreate. But the widgets of your activity are not yet rendered in onCreate. That's why you see the white screen. The second example is a good one. If you need longer time set SPLASH_TIME to longer. Check the line Thread.sleep(SPLASH_TIME) in the doInBackground function. You can wait more.

Android: How to access display (Activity) of different app that is not shown in upper layer

Hello Android developers,
Im more or less expierenced in Android programming and now i want to create an app that is allowed to access the display of another app or the activity that is less my app. Both apps should be active, should run. My app shall access the display data of the other app (also can be android system display), change it a bit and then show it again.
Is it possible without root rights?
Is there any Android support class that could help me? Which way i can go?
I hope my problem is clear and you can help me!
Ok now I have a more detailed question: How can open my app and show a transparent RelativeLayout, so that you can see what is below my app?
Thankyou a lot
Martin
If both applications are yours, you can access the other Activity using a connection between them (sockets, pipes, shared files, etc.)
If you'd like to create an overlay and display something on top of the other app, you can do that using a 'system window' popup. For example: Popup window in any app
If the other app is an arbitrary software without any modifications, such thing is not possible as it would lead to security issues. Both applications are Unix processes running in their own sandboxes without any direct communication.

Demoing android app screenshots

I need a way to show off concept designs of an android application on an android phone to simulate that it is running. Basically just being able to tap to advance to the next photo/screen would be sufficient with a tap ANYWHERE on the screen. Any tools you know that would be helpful?
Eclipse with Android toolkit.
Write a small program. wont take up much time.
[update]
No coding is required. Create an android project Using Eclipse android project, you can visually create UI prototype (i.e. drag and drop .. no coding). Use main.xml after developing each screen run the project in emulator, you can take screenshot of the same (either using eclipse DDMS plugin's snapshot capability or using Alt+Print screen in windows or something similar in other OS). Use this screenshot in a powerpoint presetation . Repeat the same process for a second screen (overwrite the same main.xml so that you dont have to write code). take screenshot again. Add the required animations in powerpoint.
Is there any other option that does not involve any code?
The easiest way I can think of is:
1. Take screen shots(wireframes, screen prototypes) for every screen flow you wish to demonstrate.
2. add them in proper sequence(regulated by sequence number) to your sdcard.
3. Open Picture gallery and use swipe gesture to transition and cycle between screen, walk through all the screen flows.
Do it photoshop, create images, add it to an activity. Create a layout that fills the parent, add it as a background. Then implement a ontouch method to finish the activity and load the next. Quite simple.

Categories

Resources