Trasparent intro overlay to introduce user the app - java

I was wondering to create something like a setup wizard for when the user first starts my app. This is needed due to the complexity of the app to help the user. Searching for something like this I found a library that isn't a setup wizard, but lets you point an element on the screen and give some info about it.
The library is this link. (Showcase View Library by Espin)
I'm able to show one indication using this, but I can't concatenate more than one indication, you know, the first is shown, you pulse next and goes to the nex indication, this way until you arrive to the end and pulse finish.
Looking for any tutorial or step-by-step guide that could help me doing this, I found one, but it was done with old code, and the newest version of the library has some changes that doesn't fit the example. I've tried modifiying the code of this example to match with the new version of the library, but I don't get to view the indication one by one, I just get all them overlapped.
This is the link to the library's ShowcaseView class where all this logic is defined: ShowcaseView.java
And this is how the doc says to implement it ot your app:
new ShowcaseView.Builder(this)
.setTarget(new ActionViewTarget(this, ActionViewTarget.Type.HOME))
.setContentTitle("ShowcaseView")
.setContentText("This is highlighting the Home button")
.hideOnTouchOutside()
.build();
Has someone worked with this library and knows how could I concatenate few indications?

What's missing in v5
ShowcaseViews: the class which queues up ShowcaseViews in a
tutorial-type method. I never really liked this class (generally, you
should use SCV sparingly); I'll add it back in based on the Builder
class when I can.
So either:
implement it by yourself and submit a pull request.
Or wait for the next release.
Or use v4
Or submit an issue on github to directly ask the author when this will be released.

Related

Is it possible to create a custom screen GUI in Bukkit?

I'm wondering if it's possible to add some custom screen GUI's to my Bukkit server. So I can display a lot of text on someone's screen. Or do I need to find another option to do this?
Thanks!
The only practical way is to use an Inventory using blocks with name and lore for users to click on as can be seen here
As Cole Nelson mentioned, a custom inventory with lore displayed might work. A good guide for that can be found on the bukkit forums, and although it's a bit outdated it should still provide useful information.
Another possibility would be to utilize title screens; obviously those can't hold a ton of information, but the player is pretty much guaranteed to notice them immediatly.
I recommend using Title Api, as it's a bit tedious to directly work with packets.
Once you added the jar to your project and set the dependency, simply use:
TitleAPI.sendTitle(player,fadeIn,stay,fadeOut,"Title","Subtitle");
to send a title with all corresponding attributes.
Example result:

Vaadin - pass data to different UI

I am new to Vaadin and I tried to find the answer to this by searching SO as well as Google so any help will be appreciated or at least point me in the right direction.
My app navigates from one view to another using the following logic
ActivitiesUI startUpActivity = new ActivitiesUI();
UI.getCurrent().setContent(startUpActivity.buildMainArea());
I need to know how I can pass data (like a String or an int) from the current UI to the one being navigated to (in this case startUpActivity)
Coming from an Android background, I am thinking along the lines of an Intent
After some digging into the Wiki, I ended up using the Http Session to set and get the variables and it is working fine.

How to store and read user usage data of my application in Android using java?

I have created a an application for a project - it's very basic... what I would like to do next is see how users are using my application e.g. buttons pressed, which page is viewed the most, for how long etc.
I am new to java and I do not understand how I can implement such thing; I have an idea but do not know whether it is efficient;
I would add a counter for each of the buttons in my app, whenever a button is pressed the counter increases by 1 and so on and so forth;
To see how long a user stays on a page, I could add a timer when the user enters the page, timer starts and stops when user exits.
...
Would something like this is viable and efficient? are there better ways of implementing such algorithm.
Not sure if there are, I searched but couldn't find any, does google offer such service like they do for websites with google analytic.
I am sorry, I've no to show this, as I haven't actually starting doing it. Wanted to get a grasp of it before I do and find out whether it is the correct strategy.
I would really appreciate your help.
https://developers.google.com/analytics/devguides/collection/android/v4/
Analytics for android apps maybe its what u are looking for
Start here: http://www.google.com/analytics/mobile/
https://developers.google.com/analytics/devguides/collection/android/v4/
You could also go with that you stated already, and add those values to an array. Just note that this will require you to turn on some permissions which might make your app unpalatable for some individuals.

How to use "Simple Validation API" to validate Java Swing forms in Netbeans

I have downloaded and installed the "Simple Validation" NetBeans Plug-in, but do not know how to use it, because I cannot find where is it present (in toolbox).
Can anyone kindly help me by telling how where can I find it and what are the steps to apply the validation on my form fields.
I also saw there was a Validation API JAR file and I downloaded and included it in my project. It provided 3 controls (or whatever I should say); "ValidationPanel", "ValidationUtils" and "Problems". I saw an example at a website & followed it. I dragged-and-dropped the "ValidationPanel" and wrote the code as shown in following code
final ValidationGroup group = validationPanel1.getValidationGroup();
group.add(txtUserName, Validators.REQUIRE_NON_EMPTY_STRING,
Validators.NO_WHITESPACE,
Validators.REQUIRE_VALID_INTEGER);
But it seems JAR file contains incomplete files or there may be other problem, because it gives error: cannot find symbol: variable "Validators"
I am sorry I think these are 2 questions, but kindly help me how to solve it.
Thanks in advance
You just want the "ValidationPanel".
It seems to be called "org.netbeans.validation.api.builtin.stringvalidation.StringValidators" now.
final ValidationGroup group = validationPanel1.getValidationGroup();
group.add(txtUserName, StringValidators.REQUIRE_NON_EMPTY_STRING,
StringValidators.NO_WHITESPACE,
StringValidators.REQUIRE_VALID_INTEGER);
What you're doing with those lines is creating a validation group and adding a field with 3 validation rules but you still need a way to show that on screen.
Simple validation API provides 2 built-in UI helpers that I'm aware of, you can either use the org.netbeans.validation.api.ui.swing.ValidationPanel or the org.netbeans.validation.api.ui.swing.SwingValidationGroup.createProblemLabel(), otherwise you'll have to implement your own UI widget with the org.netbeans.validation.api.ui.ValidationUI interface.
ValidationPanel creates a JPanel to hold your input controls plus ok and cancel buttons plus the label to show the error messages.
On the other hand you have the ProblemLabel which is the easiest implementation and for me it works in most common cases, here's a little example:
SwingValidationGroup group = SwingValidationGroup.create();;
group.add(txtUserName, Validators.REQUIRE_NON_EMPTY_STRING,
Validators.NO_WHITESPACE,
Validators.REQUIRE_VALID_INTEGER);
JComponent validationLabel = group.createProblemLabel();
contentPanel.add(validationLabel);
That way you have the validationLabel that you can add to any other container like a JPanel or to the form itself, in this case I have a panel named contentPanel that I attach the problem label to.
Hope this clarifies it a little bit as this is an awesome API with poor documentation.
Did you import the required package?

Autocomplete functionality for contacts module

I have an application which has a contacts module and I am using JAVA for the same.I have to implement the "Auto complete" functionality for the same. I.e., as i start typing the alphabets, search results start appearing and will eventually narrow down to the matching letter after entering the same.
Please help me with some reference JAVA code, API's and some cool stuffs to go as an add-on.
If you are looking for some example see this
http://viralpatel.net/blogs/2009/06/tutorial-create-autocomplete-feature-with-java-jsp-jquery.html
This one is basic example to make a auto complete.
And if you want some jazzy look and field then you can use jquery plug in client side
http://jqueryui.com/demos/autocomplete/
http://www.devbridge.com/projects/autocomplete/jquery/
http://www.ajaxdaddy.com/demo-jquery-autocomplete.html
I think this will help you.
I think you need to use Ajax for the same . Check out irctc.co.in , they use Ajax for station completion , quite effortlessly

Categories

Resources