[Q] Making a new Screen? - Android Software Development

Hi, is this the common way of making a new Screen or not? Because I can't belive that i have to do a new *.java File and *xml File for every new Screen and then have to edit the manifest file.
So tell me, are there other possibilities?
Thanks Spazzt

Spazzt said:
Hi, is this the common way of making a new Screen or not? Because I can't belive that i have to do a new *.java File and *xml File for every new Screen and then have to edit the manifest file.
So tell me, are there other possibilities?
Thanks Spazzt
Click to expand...
Click to collapse
What do you mean by "a new Screen"?

Well I have a screen with a button, and wehen i press this button a new screen should come up with a bit of text and a few other buttons etc.
I followed this tutorial, but i think it's just wrong...
Code:
h*t*t*p*://learnandroid.blogspot.c*o*m/2008/01/opening-new-screen-in-android.html
Sorry not allowed to post Links with my 3 Posts...

Spazzt said:
Well I have a screen with a button, and wehen i press this button a new screen should come up with a bit of text and a few other buttons etc.
I followed this tutorial, but i think it's just wrong...
Code:
h*t*t*p*://learnandroid.blogspot.c*o*m/2008/01/opening-new-screen-in-android.html
Sorry not allowed to post Links with my 3 Posts...
Click to expand...
Click to collapse
Sorry, I can't help you here. But you should explain better what you are talking about in your first post, because i.e. I understood how to make a new homescreen :S

Well read the Link i have posted so it is clear what i mean.

Nothing wrong with the java in that link, that's exactly how you would open a new intent (with a few variations maybe).
What exactly is wrong with it?
edit: Is it because you don't want to have a new .java/.xml for each screen? It would get pretty messy and hard to read otherwise

Ok, when you say thats the right way, it's ok.
I'm new to this andoid/java stuff.
But isn't there an easyer way to do this "new screen", some thing of automation in the sdk or eclipse?
I think it's really uncomfortable to do all these stepps by hand only for just one new screen. An app with many screen will grow really fast in that way, therefore i thought that this wasn't right though...

Yes, the proper way to create a new screen is to switch to a new activity, which has its own layout associated with it.
Its possible to have the sort of setup you're talking about... but it would be a workaround:
(pseudo-code)
<LinearLayout
...<LinearLayout id="page1"
......<Button
......<Button
......<Button
...</LinearLayout
...<LinearLayout id="page2"
......<Button
......<Button
......<Button
...</LinearLayout
</LinearLayout
If you wanted to, you could do something like...
RelativeLayout p1 = (RelativeLayout) findViewById(R.id.page1);
p1.setVisibility(View.GONE);
RelativeLayout p2 = (RelativeLayout) findViewById(R.id.page2);
p2.setVisibility(View.VISIBLE);
But again... thats kind of silly, and as your app becomes more complicated im not sure if thats the ideal approach

Related

Config HTC Home clock(not just pictures)?

Anyone knows how to make HTC Home's clock show the seconds too? I searched through the forums and could only find one other user asking the same question in a thread.
I look through the registry and there's nothing also.
Even if you don't know, supposing that what I'm asking is remotely possible, where should I be looking at? Where is the program that puts together the images in /windows to make the clock work? Any hints?
Thanks
You can't normally even with HTC Home customizer. I'm thinking you would have to hex edit the crude out of it to do this. Might as well just make a new program.
Conversely, you can probably do this with rltoday.
Sorry double post
blazingwolf said:
You can't normally even with HTC Home customizer. I'm thinking you would have to hex edit the crude out of it to do this. Might as well just make a new program.
Conversely, you can probably do this with rltoday.
Click to expand...
Click to collapse
Yeah I'm using batterystatus' clock, but I wanted HTC Home because of its functionalities. Well, I'll see if I come up with a thing or two.

Show keyboard while hiding SIP toolbar below

Hey,
I am developing for WM5 using C# ... is there any way that I can show my SIP keyboard but without the bar below it? I am running my App fullscreen and it just looks silly with the little bar below it... also it's a waste of real estate of the screen.
this is a pic of what I mean
Is there any reg key/COM usage/code/workarounds or anything I can do (not sticking something on the screen ) to hide this while showing the keyboard?
Mark
is this is an iphone keyboard??
i understand your pain. This is a design decision from Microsoft so that the user is able to switch on and off the keyboard at any time. But obviously they messed it up.
When I was trying I was not even able to draw something upon it to at least make it invisible. Anyway, if u are programming in C++ you could create your own SIP class. try this article from MSDN to help you out http://blogs.msdn.com/windowsmobile/archive/2005/02/10/370355.aspx
Hehe... yes it is indeed an iPhoney keyboard
I got it using the PCMKeyboard Here and then skinning it with this skin I actually found somewhere in xda dev forums
I have seen that link, that would allow me to create my own SIP keyboard and add it in... I like the iphone one and want to use it.. just without the stupid little icon. I'm happy to hack it off but ideally only when in my app... it'd be a bit annoying to lose it permanantly. I was thinking about some way to even force it offscreen... so it's "there" it's just not visible? ... might be a load of hassle as id'd have to catch the scrollbar everytime and only show it when the screen content was > screenheight + 20 px or something... but that might be an idea. Obviously I could write a keyboard controll but that's a lot of hassle to write and skin it.... unless there is already one in .net out there
Hope some xda dev genius can come up with a better solution though...
Resco Keyboard Pro also has iphone keyboard skin.
Yeah we work closely with Peter and the guys at resco with their mobile forms toolkit and co-design a lot of custom items... unfortunately that is just another SIP keyboard... so I would run into the same problem of hiding the evil little icon/toolbar.
There must be someone here who knows how to do this.. I mean I just watched videos of people proving they are smarter than HTC and writing OpenGL drivers for a phone!! lol... I might go and annoy a jr developer to make myself feel smart again as reading posts in this forum are no good for my ego
Not sure if there is anything in here for you. I can't see what your after, but I'll post it anyhow. You might be able to gleam something from it...
http://msdn.microsoft.com/en-us/library/aa182530.aspx
Ta
Dave
DaveShaw said:
Not sure if there is anything in here for you. I can't see what your after, but I'll post it anyhow. You might be able to gleam something from it...
http://msdn.microsoft.com/en-us/library/aa182530.aspx
Ta
Dave
Click to expand...
Click to collapse
Hmm... nothing there, but thanks very much. I have created a menu bar and when I add more than 2 items to it the sip icon moves to the right hand side, so there is obviously something somewhere that can control this... if it is docked in that menu, I wonder if there is a way to hide the menu as opposed to removing it and possibly hide the sip thing too??! or the sip thing might exist "above" the bar and just appear to be on it....
Any more ideas would be very welcome!
Cheers for the help,
Mark
I'm no programmer so I can't help. But I remember when I was using PocketCM contacts (written by the tene who wrote PocketCM keyboards), during the sms screen the keyboard will popup but the little "evil" bar won't appear. You may want to ask tene how s/he achieved that.
wearefree said:
I'm no programmer so I can't help. But I remember when I was using PocketCM contacts (written by the tene who wrote PocketCM keyboards), during the sms screen the keyboard will popup but the little "evil" bar won't appear. You may want to ask tene how s/he achieved that.
Click to expand...
Click to collapse
Ooh... cheers for that! I'll post on the PocketCM forum and see if I can get an idea.. or is he a member here?
Can't believe how much hassle such a small thing is... unfortunately my plan to push the form 25px lower to simply hide the bar doesnt seem to be working....
Mark
I just saw the thing about the Q&A thread ... so sorry for doing this... but in for a penny and all that...
I have seen here what looks like the code to hide the sip button.. but I am unsure how to call that in c# anyone able to help?
markmcgookin said:
I just saw the thing about the Q&A thread ... so sorry for doing this... but in for a penny and all that...
I have seen here what looks like the code to hide the sip button.. but I am unsure how to call that in c# anyone able to help?
Click to expand...
Click to collapse
Im having a play, let me see what I find...
Dave
Cheers dave!
Much appreciated!
Heres a quick Port of what I need to do to show/hide the SIP.
Did you also spot the link to the C++ article at the bottom. (http://support.microsoft.com/kb/266244/EN-US/)
Ta
Dave
Dave,
Thanks for your help... that seems to just be the same as
this.InputPanel1.enabled = false;
and if you still click there it proceeds to appear. I really want the keyboard up.. but with no icon or space down there. (Tempted to say it's impossible just to spark peoples interest in a challenge! lol)
I have tried this and it's PERFECT for what I want... only in VB
So I am going to have a go at converting it to c# ... but we all know... this will never work... lol so I will keep you posted and put the solution up when I finish. (P.S - Please dont tell my boss I've spent all day on this... but you know what it's like when you come up against a problem that puzzles you!)
HORRAY!
We have success... this is based on the work from the link that the guys in the above post have done in VB... I won't lie I don't understand it 100% but I get most of it. I have ported it over to .cs and it works a treat!
the commented out line in the code is for me, I have a custom iphoney SIP with different dimensions in it. The project as is should work for the standard windows kb sip.
Thanks so much for all the contributions and help though!
solution is attached
markmcgookin said:
HORRAY!
We have success... this is based on the work from the link that the guys in the above post have done in VB... I won't lie I don't understand it 100% but I get most of it. I have ported it over to .cs and it works a treat!
the commented out line in the code is for me, I have a custom iphoney SIP with different dimensions in it. The project as is should work for the standard windows kb sip.
Thanks so much for all the contributions and help though!
solution is attached
Click to expand...
Click to collapse
Grats Mark,
I was just looking at that code. What it does, is it gets the Handle of the Window of the SIP (keyboard and the bar your trying to hide) using Find Window, SipWndClass is the name of the SIP window.
And them moves them down, off the bottom of the screen.
Ta
Dave
I dont mean to bring up old threads but I just wanted to add a note for any one that stumbles across this on the intertubes(as i did). In fact, the sipbutton and sipkeyboard have different handles. To actually hide the sipbutton(and not just move the keyboard over top of it) you need to use the "MS_SIPBUTTON" class to get your handle instead of "SipWndClass".
i.e.
Code:
Dim h As IntPtr = FindWindow("MS_SIPBUTTON", Nothing)
MoveWindow(h, 0, Me.Height, 0, 0, False)
With Fingerkeyboard you have the option to simply not show the entire bar
Would it be possible to have this work only if your keyboard was in landscape position? I know Fingerkeyboard has this option but I would like to do the same thing with a different keyboard. Thanks in advance.
Oh wow.
I have been looking for this solution for a LONG TIME. I'd love to be able to have the same type of screen as using Pocket CM (keyboard at the bottom of the screen) in other programs, without losing the functionality of the screen buttons... like "Send" "Menu" in messaging.

[SOLVED 17-12-2009]Possible to switch position of shortcuts, or delete and add again?

Hii guys,
I was wondering if it is possible to switch the possition of the shortcuts, or do you have to remove everything and add them back again?? I couldn't find it so quickly in any other thread.
Thanks in advance
The Solution is to be found in post 6 + instructions!! Thanks to Som03ne!!!
==================================================
Here is a small app to re-order the Sense shortcuts.
Its GUI is very simple using existing controls/components, since I did not have too much time to put in it - resulting not much gui control modifications, meaning - Up - means up in the list -> down in the display.
Or to put it short - Clicking UP moves the element down, and clicking DOWN moves the element up.
On exit - you can select either to apply the changes, or drop the changes.
For changes to take effect - you should Power Off and Power On the device
(Or any other way to cause Sense to Exit and Re-Load)
I tried it on my device and it works.
Any comments - post in this thread, and Id check for them every now and then.
===================================================
There is . . . but
Filipek88 said:
Hii guys,
I was wondering if it is possible to switch the possition of the shortcuts, or do you have to remove everything and add them back again?? I couldn't find it so quickly in any other thread.
Thanks in advance
Click to expand...
Click to collapse
You can do it with registry editor
HKLM\Software\HTC\Manila
There are keys marked with 0..9 (or 0..n)
each item is a shortcut on the home page.
Just change the numbers to the order you like.
If you want the 3rd element to be the first -
You should do the following:
rename "0" to "XXX"
rename "2" to "0"
rename "XXX" from the previous step to "2"
Enjoy.
OK thank you for the fast response, but is there no easier/faster way for this??
if not: then I'll do it with this
I have not found any
Filipek88 said:
OK thank you for the fast response, but is there no easier/faster way for this??
if not: then I'll do it with this
Click to expand...
Click to collapse
Maybe there is, but I tried to look for something easier,
and did not find anything.
(I believe it is possible to write a small app to do it,
but I dont know when I'd have the time to do it)
OK, well if you ever make something like that, send me a PM and I will post a link to your topic where you'll post the application, in my first post, so people who will search for this answer and come in this topic will find it.
Enjoy
Filipek88 said:
OK, well if you ever make something like that, send me a PM and I will post a link to your topic where you'll post the application, in my first post, so people who will search for this answer and come in this topic will find it.
Click to expand...
Click to collapse
Here is a small app to re-order the Sense shortcuts.
Its GUI is very simple using existing controls/components, since I did not have too much time to put in it - resulting not much gui control modifications, meaning - Up - means up in the list -> down in the display.
Or to put it short - Clicking UP moves the element down, and clicking DOWN moves the element up.
On exit - you can select either to apply the changes, or drop the changes.
For changes to take effect - you should Power Off and Power On the device
(Or any other way to cause Sense to Exit and Re-Load)
I tried it on my device and it works.
Any comments - post in this thread, and Id check for them every now and then.
This worked! Thanks. You just need to produce a Sense UI version. THis is especially useful if you have 16 links instead of the standard 9.
Wouldnt it be nice if you could reorder apps like on the iPhone? Not functionally necessary, but nice to look at nonetheless
Thanks again.

New HTC lock screen??

I just saw a video of the new HTC HD Mini and it's new lock screen. I was wondering if anyone had any information on this? Is it going to be ported onto any other devices?
http://www.neowin.net/news/htc-hd-mini-compared-with-htc-hd2-in-pictures-and-video
I've been playing around with the files responsible for the lock screen to mimic this functionality.
With there being no documentation it's quite difficult. I just restarted the whole thing, my last attempt had a few issues.
The main problem is, I can't figure out how to have a vertical slider. Horizontal is fine, but not vertical.
RJackson said:
I've been playing around with the files responsible for the lock screen to mimic this functionality.
With there being no documentation it's quite difficult. I just restarted the whole thing, my last attempt had a few issues.
The main problem is, I can't figure out how to have a vertical slider. Horizontal is fine, but not vertical.
Click to expand...
Click to collapse
Definitely keep me updated on your progress, I like the new look a lot more than the standard WM6.5 lockscreen. It would be great to have use of this on our phones.
Irishpride said:
I just saw a video of the new HTC HD Mini and it's new lock screen. I was wondering if anyone had any information on this? Is it going to be ported onto any other devices?
http://www.neowin.net/news/htc-hd-mini-compared-with-htc-hd2-in-pictures-and-video
Click to expand...
Click to collapse
me to buddy damn qute.
My current progress isn't any good.
Decompiled lockscreen.dll, it seems the 'slider' is hard-coded to be horizontal; meaning I can't achieve the same result through editing the CPR file.
The only thing I can think of is writing a whole new lock screen; something of which I have little idea on where to start.
No doubt I'll continue looking, seeing if there's any other secrets hidden in system DLLs that I could use; as well as seeing what I'd have to do to write a new lock screen.
RJackson said:
My current progress isn't any good.
Decompiled lockscreen.dll, it seems the 'slider' is hard-coded to be horizontal; meaning I can't achieve the same result through editing the CPR file.
The only thing I can think of is writing a whole new lock screen; something of which I have little idea on where to start.
No doubt I'll continue looking, seeing if there's any other secrets hidden in system DLLs that I could use; as well as seeing what I'd have to do to write a new lock screen.
Click to expand...
Click to collapse
I kind of figured it wouldn't be easy, which is too bad cause it looks so much better. Thanks for looking into this and if you do figure anything out or start work on one, let me know and I will happy to help test it.
Yea I was looking at that build which lacks the start menu and ok button. I really like that. My 2 hardware buttons never get used because they are on the screen... might as well rid them of the screen and get used to the hardware buttons.
Also the lockscreen looks like a stock lockscreen just modified.
HTC moves the lockscreen files into \Windows\Lockscreen. If I had a rom dump I could probably get something working.
http://forum.xda-developers.com/showthread.php?t=637996

[GUIDE] The right Soft Keyboard (+adding a CustomKeyboard)

Hi devs,
During development of my app (see my signature), I researched a bit and finally found a quite nice way to implement a custom keyboard which is only shown in your app easily.
Much of this is taken from Maarten Pennings' awesome guide here, thanks to him and feel free to read it as well.
So I thought I'd extend his work with this guide which also takes a look at why you'd want to use one or the other keyboard. Enjoy! :victory:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Limits of the Android IME
Any kind of text input (password, number, address, etc.) is usually handled very nicely using the android:inputType attribute (or the corresponding setter in java) on the EditText field.
But as soon as you have to deny some characters, for instance you want the user to insert a file name, it gets more complicated since there is no inputType for that.
The way to achieve that would be to implement your own KeyListener like this:
Java:
import android.text.method.NumberKeyListener;
//...
// set a new KeyListener onto your desired EditText, overriding the default one:
EditText edit = findViewById(R.id.edittext);
edit.setKeyListener(new NumberKeyListener(){
@Override
public int getInputType() {
// should be the same as android:inputType, for all numbers including decimal and negative:
return (InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL | InputType.TYPE_NUMBER_FLAG_SIGNED);
}
@Override
protected char[] getAcceptedChars() {
// declare your desired chars here, ONLY those will be accepted!
// for instance numbers:
char [] res = {'1', '2', '3',
'4', '5', '6',
'7', '8', '9',
'0', '+', '-', '*', '/',
'(', ')', '.', ',', ' ', '^', '!',
// alphabet:
'a', 'b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y',
'z'
};
return res;
}
});
The problem is that the keys are still present and therefore distracting and irritating to the user, because nothing happens on click.
And also, there might be a much easier and better accessible layout for your set of keys. In the following I will tell you how to integrate such a custom layout using the KeyboardView class, but first let's take a look at the advantages of both keyboards:
Android IME or KeyboardView???
The answer to this question is tightly depending on the task you want the user to fulfil, and also on how much freedom you want to give him. The high customizablility and its theming options are a strong point for the KeyboardView, but be warned that since this View was added in API level 3 (and never updated I think) there are a couple of bugs which you have to workaround.
A standard keyboard is more familiar to the user and is often also a third-party keyboard and therefore more customizable. But this also has its downsides since there is no guarantee that the IME will display the characters you need.
Note that you will not be able to get a working cursor image easily with the KeyboardView (though the cursor works as it should, just the blue arrow below it won't be displayed).
For simple tasks where just a few buttons will be useless, such as when asking for a filename the normal IME is recommended. But for various operations you'll find the KeyboardView to be much cleaner.
If you decided to try the KeyboardView, here's how it works:
Adding a CustomKeyboard
NOTE: I will only cover how to implement such a Keyboard, if you want to know how it works in detail check out the third chapter in Maarten Pennings' guide.
First, since it is a view, you will need to manually insert the following to the xml layout file of all activities where you want to use it:
Code:
<android.inputmethodservice.KeyboardView
android:id="@+id/keyboardview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:visibility="gone" />
Put it in a relative layout container, though it should also work in other ones. Most important is that it is the topmost container in the view hierarchy.
Second, you need an xml file where all the keys and their layout are stored for the KeyboardView to inflate. For a start, you can take the one Maarten Pennings has posted or download mine here: View attachment keyboard_layout.txt (xda doesn't support .xml files, so just rename it to keyboard_layout.xml!)
Move that file to your res/xml/ folder, you can create other layouts for landscape using res/xml-land/
You have to play around with that file a bit to get your desired layout, here are some tips:
Start by designing it on paper, then write it as a comment (ASCII-Art‎?) so you have it properly lined up and always at your hand while coding
Including gaps of half a key or so to separate different areas works nicely
Highlight important keys either with a different android:keyBackground or by making them larger than the others.
Leave the android:horizontalGap attribute untouched on Keyboard level, this will probably break the key lineup
Calculate the key width like so: width = 100/(keysPerRow + numberOfGaps)
Set the android:keyHeight on Keyboard level to something that rows*keyHeight is about 40%-50%.
For every key label which is longer a single character, use the corresponding ASCII-integer as key code (android:codes), otherwise pick a negative number or one that's higher than 256
Use android:isRepeatable="true" for keys to press and hold for multiple clicks like the delete key
If you want to display a popup keyboard on hold, you should rather make a popup window yourself or use a dialog rather than using the androidopupKeyboard attribute.
For inserting more than one char on click, use the android:keyOutputText on key level or override the specific keycode in the onKey() method in CustomKeyboard.java
As I said, you will need some patience doing this since there is neither help nor documentation on the xml namespaces.
Third, there are a couple of icons required for some keys like the delete key. You can either use the ones provided in the guide, but I suggest downloading the original holo android icons from the different drawable folders here.
Take the sym_keyboard_... files that you think you'll need and place them in the respective res/drawable-ydpi folder. Set the android:keyIcon attribute to @drawable/sym_keyboard_... for those special keys.
Fourth, we need a java class to process the clicks and provide the methods for showing and hiding the keyboard. Luckily, you take mine here: View attachment CustomKeyboard.txt (again, rename it to CustomKeyboard.java)
Copy that file into your src/com/package/name and change the package to your app.
This class is heavily based of the one Maarten Pennings has come up with, but with an actually working cursor, so that you can tap or drag to move the cursor. I included haptic feedback (set it using enableHapticFeedback(true)) and an easy way to add chooser dialogs if you want to have multiple insertions in one key (see the onClick(...) method); This looks like this:
If you are using any special keys or dialogs as popups, you will need to edit the onKey() or the onClick() method like I did.
Fifth, in your onCreate() method after setContentView(...) you just need to register every EditText that you want to use the keyboard on like so:
Java:
// initialize the instance variable customKeyboard
customKeyboard = new CustomKeyboard(this, R.id.keyboardview, R.xml.keyboard_layout);
// register the edittext
customKeyboard.registerEditText(R.id.edittext);
For a hiding keyboard if you press the Back key, add the following to your activity:
Java:
@Override
public void onBackPressed() {
if(customKeyboard!=null && customKeyboard.isCustomKeyboardVisible() ) customKeyboard.hideCustomKeyboard(); else super.onBackPressed();
}
Click to expand...
Click to collapse
Congrats, you have finished adding a CustomKeyboard and can now test and further improve it :good:
Read on if you want to theme it further (let's face it, the default theme is still from the first versions of android).
Theming your Keyboard
Theming the KeyboardView
To make your newly created keyboard fit more to the overall style of your app, it is crucial to theme it.
Here are some attributes which you'll want to customize:
Code:
<!-- on KeyboardView level: (in android.inputmethodservice.KeyboardView in your activity) -->
android:keyBackground
android:keyTextColor
android:keyTextSize
android:background
<!-- on Key level: -->
android:isSticky
<!-- for toggle keys like shift or ALT only -->
android:isModifier
These are all pretty self-explanatory, the most important one being the keyBackground.
You will need different drawables for each of the keys states including normal, pressed, active, popup and either light or dark theme.
As an example, here's how I made the holo style: Basically I took the holo drawables from source and added android:keyBackground="@drawable/btn_keyboard_key_ics" in our KeyboardView (not Keyboard!).
Download those icons from here.
Specifically, you need the btn_keyboard_key_ics.xml file in the drawable folder and all the btn_keyboard_key_... from the xhdpi, hdpi and mdpi folder that you need, at least btn_keyboard_key_dark_normal_holo and btn_keyboard_key_dark_pressed_holo.
The btn_keyboard_key_ics.xml goes into your res/drawable folder and all the others should be dumped into their respective res/drawable-ydpi folder.
From the key_ics file delete all items where you didn't download the .9.pngs so they don't give compilation errors.
Click to expand...
Click to collapse
I hope you found this helpful and I could save you a bit of work. If you have any questions or suggestions, feel free to post them here!
This guide was featured on the portal on 26th October (thanks Will Verduzco!)
Wow. Really cool guide. :good:
Can we edit the third party stock keyboards....
SimplicityApks said:
Theming the KeyboardView
To make your newly created keyboard fit more to the overall style of your app, it is crucial to theme it.
I hope you found this helpful and I could save you a bit of work. If you have any questions or suggestions, feel free to post them here!
This guide was featured on the portal on 26th October (thanks Will Verduzco!)
Click to expand...
Click to collapse
Since i like the stock keyboard of htc one ... just wanted to know if i replace the resources of stock keyboard of AOSP with that of keyboard from
htc one will it work or do i nedd to do some modding....
anurag.dev1512 said:
Since i like the stock keyboard of htc one ... just wanted to know if i replace the resources of stock keyboard of AOSP with that of keyboard from
htc one will it work or do i nedd to do some modding....
Click to expand...
Click to collapse
You mean you want to have a KeyboardView in your app with the layout files from the HTC keyboard? Sure, that'll work, you only need to get the resources (decompile keyboard app?). Some layout adjustments might be needed of course...
reply
SimplicityApks said:
You mean you want to have a KeyboardView in your app with the layout files from the HTC keyboard? Sure, that'll work, you only need to get the resources (decompile keyboard app?). Some layout adjustments might be needed of course...
Click to expand...
Click to collapse
no bro i m saying to mod the stock keyboard of jellybean with that of stock keyboard of htc one...
anurag.dev1512 said:
no bro i m saying to mod the stock keyboard of jellybean with that of stock keyboard of htc one...
Click to expand...
Click to collapse
OK, sorry, I didn't read the title of your post...
That should be possible, although I have no idea about decompiling and modding. From what I understand, you could try making an XPosed module, that should work and is better since it can be applied at runtime.
SimplicityApks said:
Hi devs,
During development of my app (see my signature), I researched a bit and finally found a quite nice way to implement a custom keyboard which is only shown in your app easily.
Much of this is taken from Maarten Pennings' awesome guide here, thanks to him and feel free to read it as well.
So I thought I'd extend his work with this guide which also takes a look at why you'd want to use one or the other keyboard. Enjoy! :victory:
View attachment 2347941
Congrats, you have finished adding a CustomKeyboard and can now test and further improve it :good:
Read on if you want to theme it further (let's face it, the default theme is still from the first versions of android).
Click to expand...
Click to collapse
Nice
FunctionCapture
I just released my app to the Play Store, so if you want to see how the CustomKeyboard feels in action, download it here:
FunctionCapture
You might want to leave a review or +1 as well, that helps a lot, thanks!
SimplicityApks said:
Theming the KeyboardView
To make your newly created keyboard fit more to the overall style of your app, it is crucial to theme it.
I hope you found this helpful and I could save you a bit of work. If you have any questions or suggestions, feel free to post them here!
This guide was featured on the portal on 26th October (thanks Will Verduzco!)
Click to expand...
Click to collapse
hi... I am not able to download resources for custom keyboard... please help me
tejal said:
hi... I am not able to download resources for custom keyboard... please help me
Click to expand...
Click to collapse
Well I can still download it, might be a problem with either your browser or xda where you live...
Thanks for the tutorial, really helped me with my project as I need a custom keyboard. But I would like to ask, how do I add a second page to the keyboard as I need more entries to it. Is there a way to add like a small button in the keyboard 1/2 and when you press it, it'll go to the 2nd page of it.
misleading93 said:
Thanks for the tutorial, really helped me with my project as I need a custom keyboard. But I would like to ask, how do I add a second page to the keyboard as I need more entries to it. Is there a way to add like a small button in the keyboard 1/2 and when you press it, it'll go to the 2nd page of it.
Click to expand...
Click to collapse
Mmmmh didn't think about that so far... Have you tried wrapping 2 keyboardviews in a viewpager?
SimplicityApks said:
Mmmmh didn't think about that so far... Have you tried wrapping 2 keyboardviews in a viewpager?
Click to expand...
Click to collapse
I think I got it somehow.
I made a small key in the current keyboard. An example maybe like SYM which represents Symbol, so if you press it, it'll go to the view on keyboard full of symbols. Just had to repeat actually.
Edit: It seems like I can't post the code or part of it. Says that my post was flagged by the system and was blocked from submitting. I want to show how, but it seems it doesn't allow me haha.
misleading93 said:
I think I got it somehow.
I made a small key in the current keyboard. An example maybe like SYM which represents Symbol, so if you press it, it'll go to the view on keyboard full of symbols. Just had to repeat actually.
Edit: It seems like I can't post the code or part of it. Says that my post was flagged by the system and was blocked from submitting. I want to show how, but it seems it doesn't allow me haha.
Click to expand...
Click to collapse
Lol sometimes the system is against us..., well nice you figured it out
I am lost/stuck
First off I would like to thank Simplicity for such a simple guide and tutorial on how to set the custom keyboard up. Secondly even if it was very simple I obviously cannot follow directions and have done something wrong and even though my custom keyboard pops up and I am able to press the button, I am not able to get the edittext field to register the onclicks of the keys thus resulting in the buttons doing nothing. I have pmed Simplicity and was requested by him to post this question in the thread for others in case anyone else runs into this issue.
I have attached both the xml and java file to the post.
Hope someone can help and also hope this problem I ran into will help others if they are stuck at the same place.
Once again a big big big Thanks to SimplicityApks.
kva123 said:
First off I would like to thank Simplicity for such a simple guide and tutorial on how to set the custom keyboard up. Secondly even if it was very simple I obviously cannot follow directions and have done something wrong and even though my custom keyboard pops up and I am able to press the button, I am not able to get the edittext field to register the onclicks of the keys thus resulting in the buttons doing nothing. I have pmed Simplicity and was requested by him to post this question in the thread for others in case anyone else runs into this issue.
I have attached both the xml and java file to the post.
Hope someone can help and also hope this problem I ran into will help others if they are stuck at the same place.
Once again a big big big Thanks to SimplicityApks.
Click to expand...
Click to collapse
Had a look at your class and the xml keyboard layout again and everything seems fine to me so far... Question is how you implemented the keyboard in your activity layout and what happens when you register your text field in the onCreate(). It would be helpful if you could show us these parts of your code.
Other than that, does your onKey() method in the CustomKeyboard get called when you press a key? (Put a Log.d(..) statement or debug stopped in there to find out)
SimplicityApks said:
Had a look at your class and the xml keyboard layout again and everything seems fine to me so far... Question is how you implemented the keyboard in your activity layout and what happens when you register your text field in the onCreate(). It would be helpful if you could show us these parts of your code.
Other than that, does your onKey() method in the CustomKeyboard get called when you press a key? (Put a Log.d(..) statement or debug stopped in there to find out)
Click to expand...
Click to collapse
Hey sorry for the late response I just figured out what the problem was but now I have no idea how to fix it. The problem is here
Code:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="10dp"
android:padding="10dp"
android:descendantFocusability="beforeDescendants"
[COLOR="Red"]android:focusableInTouchMode="true" //This Right here is the problem[/COLOR]
android:weightSum="6" >
<TextView
android:id="@+id/billtotalTV"
android:layout_width="0dp"
android:paddingLeft="25dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="Bill Amount:"
android:textColor="#B34F6675"
android:textSize="25sp" />
<EditText
android:id="@+id/et"
android:layout_width="0dp"
android:paddingRight="25dp"
android:layout_height="wrap_content"
android:hint="Enter Total"
android:gravity="center_horizontal"
android:textColor="#049C7A"
android:textColorHint="#B3049C7A"
android:inputType="numberDecimal"
android:imeOptions="actionDone"
android:maxLength="7"
android:textSize="30sp"
android:layout_weight="3"/>
</LinearLayout>
The Reason I have that is because I am trying to avoid my app from setting my EditText as a focus as soon as the activity starts. As far as I am aware I do not know of any other methods that can work around that. Let me know what you think I should do.
kva123 said:
Hey sorry for the late response I just figured out what the problem was but now I have no idea how to fix it. The problem is here
Code:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="10dp"
android:padding="10dp"
android:descendantFocusability="beforeDescendants"
[COLOR="Red"]android:focusableInTouchMode="true" //This Right here is the problem[/COLOR]
android:weightSum="6" >
<TextView
android:id="@+id/billtotalTV"
android:layout_width="0dp"
android:paddingLeft="25dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="Bill Amount:"
android:textColor="#B34F6675"
android:textSize="25sp" />
<EditText
android:id="@+id/et"
android:layout_width="0dp"
android:paddingRight="25dp"
android:layout_height="wrap_content"
android:hint="Enter Total"
android:gravity="center_horizontal"
android:textColor="#049C7A"
android:textColorHint="#B3049C7A"
android:inputType="numberDecimal"
android:imeOptions="actionDone"
android:maxLength="7"
android:textSize="30sp"
android:layout_weight="3"/>
</LinearLayout>
The Reason I have that is because I am trying to avoid my app from setting my EditText as a focus as soon as the activity starts. As far as I am aware I do not know of any other methods that can work around that. Let me know what you think I should do.
Click to expand...
Click to collapse
So you mean it works perfectly without the focusableInTouchMode="true"? Strange... Then just leave the focus there and hide the softkeyboard in your onCreate() or is there any other reason you don't to have it in focus except for the soft keyboard popping up? (Then set the focus to another view might be the easiest ).
SimplicityApks said:
So you mean it works perfectly without the focusableInTouchMode="true"? Strange... Then just leave the focus there and hide the softkeyboard in your onCreate() or is there any other reason you don't to have it in focus except for the soft keyboard popping up? (Then set the focus to another view might be the easiest ).
Click to expand...
Click to collapse
I tried hiding the softkeyboard but for some reason it wont hide it just keeps popping up. And he main reason I do not want a focus is because I have a drawerlayout on the app and it contains 3 edit texts so everytime I open the drawer layout it invokes the keyboard to pop up and it selects the edit text which I do not want because its a feature where users may customize the value which they dont need to if they dont want too. As of setting focus to another view I believe I tried that but the edit text still receives the focus for some reason. Mind giving me an example of setting focus on something else? So i can make sure I am doing it right. Maybe a Linear or Relative Layout .
I just tried to hide the keyboard and just realized I am already hiding the keyboard but I am only hiding the default keyboard not the custom keyboard. So my question for you would be how would I hide the Custom Keyboard from showing oncreate?(tried this but no luck customKeyboard.hideCustomKeyboard(); ) it still shows but it does work because i tried it with an onlclick just not working on start. Not sure if you need to edit the customkeyboard java file. If you want I can post the test code im working with right now if you dont mind looking at it.

Categories

Resources