I'm new in Android programming and I need some help.
I'm doing an app for my thesis and I need at the first access(installation) to have an information page(like Google Calendar when recently installed). And the user will be able to go on pressing on a "Next" button.
This "page" must be visible only if the application is removed and after a while reinstalled.
Can someone help me to handle this?
There are many ways to go about this. One of them would be to take advantage of the SharedPreferences in Android. Make a default value of false. When your app starts, check the value in the shared preference that you set. If it is false, show the information dialog and then set it to true. If the value is true, continue with application startup. SharedPreferences will be deleted when you uninstall the application, so your information dialog will be shown again if the user uninstalls and then re-installs your app.
Here are some examples of using SharedPreferences.
You need to store some kind of flag for this, for example you could use SharedPreferences and store a key called "firstLaunch" with a default value of true. At startup read the flag, show info if it's true, and set to false.
There is a library called Showcase View to visualize the most important functions of your app.
The ShowcaseView (SCV) library is designed to highlight and showcase specific parts of apps to the user with a distinctive and attractive overlay. This library is great for pointing out points of interest for users, gestures, or obscure but useful items.
You could use that to develop your information page.
Related
I am having some question, kindly help me out, following are my questions?
Does shared preferences data get shared across users?
Also can we have same widget IDs in two different users?
I am having a widget which any user can use. I am getting some
conflicts when a guest user or a any new user is switched to. Specifically, my widget is resizeable and in order to save its state so that it can be inflated accordingly on phone restart or some refresh events. These are working perfectly for the Admin User but it behaves abnormally when a guest is added or if the user is switched.
Yes shared preferences data get shared across users if we define CONTEXT MODE while creating SahredPreference for more detail you can read here for detail, and here. For widget id i think we can give same id in different users but here (i am not sure) also should be concept of Mode.
For example I expect this kind of situation: data in my application lost relevance and so it usless until update. And until update it have to show users some predefined message.
Is here any simple and free solution to this task?
Guess I can use some server to somehow send simple messages... but it sounds way too complicated.
If this is important I use Xamarin.
Update: main difficulty here is fact - my application can't in any way define if it's outdated or not. This may happen in random moment.
Although the requirement is not very clear I assume Update here means app update.
each time user launches app make call to an api on ur server to check if user needs to update app
If that returns true take user to a static view that says app needs update and redirects user to google play to install updates
If you want to avoid using a server, you should try Firebase (https://firebase.google.com/). More specifically, you should use Firebase Remote Config (https://firebase.google.com/features/remote-config/).
Define in a key-value pair of something like minimum_app_version_required in Firebase Remote Config. Every time user opens the your app, compare the values of app version and minimum_app_version_required that you are getting from Firebase console and show a dialog box accordingly. You can also change the value of minimum_app_version_required anytime you want.
Just set some internal flag. That when that situation occurs, you can set the flag to true and just edit whatever layout element you are using such as listView or any other element with your predefined messages saved in strings.xml. You can also build any custom pop up screen, depends how you want to show them. Let me know if you didn't understand or exactly how you want?
Need to implement versioning for this problem. To achieve this, you have to maintain a version number in server, this is the version number you app will have to save and use it to validate with server. If both are not same, then app will get the latest data from the server.
I wish to show my other apps under "More Apps" section of while exiting.
What is the the best way to do it ?
Is there is any common library to add my app icon and link of my app. so that It can be shown at the time of interest. It would be great if it is scrollable
Thanks is Advance !
Well since these are your apps you can simply hard-code the icons into a RecyclerView or ListView along with a link leading to Google Play. This really doesn't require a third-party liubrary as it can easily be done by yourself.
If you really want to allow for future expansiveness, you could use a cloud platform like parse where you store the names of different apps as parse objects along with a link and an image (logo). Then you could write a custom adapter for your list which takes the parse objects from your cloud, and populates itself with the logo,link,title,etc.
This is really a matter of comfort and preference rather than finding a library to do this for you. If you need help, feel free to ask, and good luck!
You can show a 'Dialog' asking if the user cares to check some of your other apps with two available options: 'yes' and 'no'. If the user chooses
'no', close the dialog, if he chooses 'yes' - redirect him/her to the following url:
https://play.google.com/store/apps/developer?id={Your-Google-Account-Name}
This link will be opened either in the browser or in the Google Play app, whichever your user prefers, and it'll show him/her the list of all your apps.
You can try overriding finish() (Documentation) method inside your Activity. If you're using multiple Activities, consider creating a base Activity so that you don't have to implement this in each Activity.
That said, please consider not doing this. As a user, I'd be super annoyed if I'm trying to close your app and you're not letting me do it. That'd be instant uninstallation from my side. Never annoy your users. Respect their experience.
I'm here today asking someone if they know a way to make a set up screen on first start up.
Here's the scenario: When someone downloads my app and uses it for the first time, it has to show a method where users make a password. On subsequent uses, I don't want it to be shown anymore. Does anybody know how to do this?
You can use the SharedPreferences for this purpose.
At the start of your application, check if the key "myKey+versioncode" is present or not in the SharedPreferences. If it not stored, then it means your application has not bee started yet, let the user create his/her password. Once the password is created, add the SharedPreferences "myKey+versioncode" with any value you like, and next time you will find this SharedPreferences, so it means the user already started the application and created its password.
However be careful about the "versionning" of this key, you might also want to keep a single key instead of one per version of your application.
Edit: Concept found at the time I was looking for EULA inplementation, here: Simple EULA implementation for Android
I am having an android layout having to input some of the basic details of the user.
This layout screen or activity has to come only once after installation, but it should not come up after successive opening of the application.
Could you let me know how can this be achieved in android.
Looking forward to your reply.
thanks.
you can put a flag in shared preferences that you showed once the screen and it's no need to show it again. But when the user clears data, the flag will be deleted. As a hard way, you can save this flag on a server or cloud.
I think having a flag set in shared preference is the best way to do that. And i think if the user clears his cache , then he deserves to see the screen which is shown only once on installation. Similar is the behaviour which happens everywhere. Many websites store the user information in their cache and don't show user unnecessary information but if you clear the cache then you will see that information back again