Admittedly, I am Android newbie dev. I would like to know the best approach/solution to showing intro screens for an app, and ONLY at first time use. Similar to Google Drive and several other apps that show the intro screens when you open first time. It has dots at the button to show the screen number you are in. You can swipe to left or right. After you swipe of the last screen, you will enter into the app home screen.
Link to any examples that have screenshots would be good as well.
You launch into the intro screen activity. The first thing it does is check a shared preference. If it exists, you skip the intro and launch the main activity. If it doesn't, you display the first intro screen. When you detect a swipe you switch to the proper new fragment. If its the last screen, you launch the main activity.
Related
I'm trying to make my app add a toogle button in the [Notification Panel] the place where you can toggle Wifi, bluetooth, Plane Mode, ect .., (I've spent the last 6 hours searching and I found nothing)
Here's are 2 Examples of what I'm talking about in one picture :
-In the 2 blue frames, those 2 buttons are custom buttons (meaning they have nothing to do with stock android, they've been added by apps from the Playstore),
#1 button : The Shazam button is a shortcut to open shazam (that's not what I need, although would love to know how it's done)
#2 button : First press it starts recording a video on my rear camera (the button becomes activated (blue)), second press it stops recording and saves the video, all this happens in the background, the app that does this never opens (meaning that this is not just a shortcut to the app)
=> So I'm trying to do is to have a custom button for my app, a button like the #2 button, for my app activating/disabling it would make my app's background service send TCP messages to a server, (just in case you want to know what I'm trying to do)
My phone is not Rooted, and I know for a fact that this doesn't require a Rooted phone.
(I'm trying to do this with Xamarin/c#)
sadly no one answered, so i kept searching and i found out that what i called the Notification Panel Menu, was in fact called the "Quick Panel" ..
anyways, here are some links that helped me quite much : Link 1 , Link 2
I have realised an NFC reader application
So i have 3 activities :
MainActivity, which is an activity who contains a Button. If button is clicked, the scan is activated and the user can put his NFC tag against the device to detect it.
WebActivity, who is launched if the NFC tag contains and URL (and open a WebView) or if the user want to launch WebActivity by himself
HistoryActivity, who gonna contains a list of every scans.
Now, I would like to swipe activity with a finger gesture. according to my research on Internet. I need fragments and ViewPager.
But every example that I saw is bases on ONE activity and multiple fragments.
But in my case, I have to create 3 fragments (one per activity), right ?
And I really don't know how to manage my fragment. I mean, what to put inside ?
All I want to do is create a transition/animation while changing activity... That's crazy
This is too broad of a question but hopefully my answer will steer you in right direction.
You should definitely go with single activity/multiple fragments model. Aside of recommendations by Google, you could use navigation components, deep linking much easier then without single activity.
Yes you should be using ViewPager for the purpose (and likely your implementation of FragmentPagerAdapter as well) however I do not understand what kind of swiping will you be doing
Reading your setup, I would suggest to use bottom view with 2 items (good example is here https://github.com/android/architecture-components-samples/tree/master/NavigationAdvancedSample/app/src/main/java/com/example/android/navigationadvancedsample). 2nd one would show history, first one would offer a button that activates your action, and then displays fragment with your WebView.
As a side effect of such implementation, you'd be able to go back from 2nd bottom view item to whatever first one holds - by pressing system back button - which I think is nice touch.
UPDATE to "swiping takes place anytime. " comment:
You could have single activity, ViewPager with 2 fragments. First fragment would display a button, 2nd fragment would display a history. You could freely swipe between them, as you want to. However to me it does not make sense to put WebView screen into this. WebView screen is result of action (NFC detection) and it should probably display as full screen, without any chance of swiping between main/history and itself. Hope it helps or I'm missing some important piece of info you did not share.
My first android app I'm creating, a text based game. Everything is looking great so far with functionality. I'm just wondering 2 things, one, is there a way to control how the new activity opens in the screen (new activities open from the center of the screen on my app, takes about a half second), and second, its it better to have each button pressed choice open a new activity or is there a better way to clear the screen and use the if and else commands in java.
I think as for the first part, you may want to use animation on transition between activities/fragments.
You do want to read more about fragments as i think it will solve your second question.
Check this small tutorial for the animation part.
Check docs for fragments.
Good luck.
I'm trying to writing an app that can help me to control my screen.
For example,I can press a button,and my android phone can help me to slide from left to right by itself.
Please refer to the picture as below.
I saw some of the Transfer beads Game Cheat MAYBE use this method to control the screen slide automatically, but actually I don't know how it does.
For another example, refer form the following video. In this video,he made the phone slide the screen by itself. What I want to do is as same as his work. =)
https://youtu.be/a5quGThvjT4
Thank you all in advance!
As it figured out the OP needs a drag/drop on the same screen for his problem and not swiping between activities or fragments:
The keyword is "android drag and drop": https://developer.android.com/guide/topics/ui/drag-drop.html
I currently have an application that uses Admob for serving ads. When a user click a correct answer the screen transition and then a new intent open up. This then loads the xml file layout again with the ad. When this happens the ad has to reload(it shows blank space for a few seconds then the ad comes up) even though the previous screen had an ad there before. Is it possible so that the ad from the previous screen to transition smoothly into the next screen, without having to wait a few seconds for the new ad to load on the next screen layout?
Not currently: each AdMob instance is tied to the Activity.
You could possibly use the Fragment interface to essentially tie all your functionality to a single Activity instance and then you wouldn't need to switch to a new Activity and lose the AdMob instance, but I haven't seen anyone who has done this yet.