Thursday, September 12, 2013

Using keyboard for data in Cydgets

Where the fun begins!

Things I have done with lockscreens lately is pretty unbelievable. That doesn't even compare what they can be now.

One great feature is access to a keyboard! YES! I've went to lengths to coding my own keyboards to work with widgets. I am so glad that I can say goodbye. Not only does take alot of time to code a keyboard, but the ram it takes to do the functions is much greater.


I have yet to see anyone else implement keyboards or keypads like I have. I hope this changes it.

In code we use variables for a lot of things. So of course when you give user access to change those variables a lot of great things happen.

One most common, which is what made my decision, to make a keyboard is the location variable.

You know it as var locale. This variable contains your zip code or weather code.

To get this info you leave the lockscreen open a text editor and edit the code. Everyone isn't a coder, and they should NOT have to do this.


Ok now to the meaty stuff. How do I get a keyboard in Cydgets June?

Easy use prompt. Has been on the web for ages. Here is how.

var locale = prompt("Enter your ZipCode", "");

Thats it:) haha. Yes, now your getting it. 

When this locale is called the keyboard will popup and ask for your zip. You enter it accepts.

Now you have to do this every time you unlock/lock. Remember everything resets.


Next post ill explain how to make up for it resetting.



No comments:

Post a Comment