Office Hours — Today, July 24

Thursday, July 12

Jul 24
3:55 PM
Mark M.
has entered the room
Mark M.
turned on guest access
4:10 PM
Aditya
has entered the room
Aditya
Hello MArk..
Mark M.
howdy, Aditya!
how can I help you today?
Aditya
I have been following you since long.. I like the work you do..
I am a Android Developer
Mark M.
thanks!
4:15 PM
Aditya
ok...in my Apps..I use custom keyboard as a custom view and slide it in and out on touch of edittext
I don't include it as a service...so.I have to always hide the soft keyboard..
Mark M.
if you do not want to use the device's hard keyboard or soft keyboard, why are you using an EditText?
Lujop
has entered the room
Lujop
Hi
Mark M.
howdy, Lujop!
Lujop: I will be with you momentarily, once Aditya's first question is handled
Aditya
this has worked marvelously well before JElly Bean..from Jelly bean..I think because of Project butter..when I am pressing a key on my custom keyboard..the sift keyboard tries to push in but hides and this is causing the screen to flash and push my keyboard up....then what would you suggest to use?
*soft
Lujop
Ok. I wait then. Thank you
Mark M.
why do you have "custom keyboard as a custom view" in the first place? Why not let the user use their own keyboard?
4:20 PM
Mark M.
in other words, what are you and the user gaining from this custom keyboard?
Aditya
The soft keyboard showing up and hiding process is manifesting as a screen flash..because the custom keyboard provides symbols and other keys which are not being used on soft keyboard..greek letters..chemical elements..tan sin functions..and lots of other keys
each of my apps uses a different keyboard..and they have different keys..and I don't want my keyboards to be used by other apps, so I am not using it as a service
keyboards on android are a pain..which I have found out since last 9 months or so
Mark M.
first, I really recommend that your own "custom keyboard" be a supplement to the existing keyboard, not a replacement (i.e., allow the user to use their own keyboard for letters, numbers, etc.)
beyond that, though, I have no idea how to help you
Aditya
how would I supplement my custom keyboard to the existing keyboard?
Mark M.
start by not trying to fight the existing keyboard, allowing it to appear
also, remove any likely duplicates (letters, numbers)
4:25 PM
Aditya
so you suggest me to have the custom keyboard on top of the soft keyboard? have you seen any instances of people coming up with their own keyboards in their apps?
Mark M.
I cannot answer either of those questions, sorry
let me take a question from Lujop, and I will come back to you shortly
Lujop: do you have a question?
Aditya
sure..
Lujop
Yes
I've a problem with FragmentPageAdapter and dynamically inserting pages
I tried with FragmentPagerAdapter and FragmentStatePagerAdapter but I can't get it working without a workarround to discard and create always pages
I've a question on SO with the sample code http://stackoverflow.com/questions/1084023…
Mark M.
I suspect that you will need to create your own custom PagerAdapter, but that is just a guess
Lujop
Do you have any idea on what can be happening or id I'm doing something wrong?
4:30 PM
Lujop
Mmmm, I look a moment at the code of FragmentPagerAdapter/PagerAdapter
Mark M.
you could also try swapping in a fresh PagerAdapter when you insert stuff, but that too is just a guess
it's a good question, but I just haven't tried this
Lujop
Yes it seems that the interface support insertion
Mark M.
have you played with returning POSITION_UNCHANGED from getItemPosition()?
Lujop
But the implementation seems a little trivial
Mark M.
you mentioned POSITION_NONE, but that is for removed pages
Lujop
mmm, but the position really changes normally
Mark M.
only for the ones after the insertion point
ones before the insertion point are unchanged
Lujop
Yes, but I need to insert at the second position
Mark M.
the first page would still return POSITION_UNCHANGED
4:35 PM
Lujop
I will try
Mark M.
again, it's just some educated guesses
Aditya: do you have another question, or a follow-up from your first one?
Lujop
But I think that I will need to go on custom pageradapter as you said.
Aditya
The major issue was with Keyboards..and I was looking to see if you had any ideas..
Mark M.
trying to block the soft keyboard is just going to be difficult, particularly since this is an area where device manufacturers like to tinker with Android
Aditya
you are perfectly right..behavior is weird with different devices..
Mark M.
that is why your typical calculator app does not use an EditText
Aditya
then what you suggest me to use
Mark M.
since I have absolutely no idea what your app is or what you are trying to accomplish, that is impossible for me to answer
4:40 PM
Aditya
ok..I need to type in some stuff and there is computation going on..and the results how up
*show
it is sort of a general calculator..
Mark M.
then I would model your app after existing popular calculator apps
see what they do, and follow suit
for example, I use Droid48
Aditya
ok...can you name me some..
ok
Mark M.
it has an on-screen keyboard, but it does not use an EditText
I do not know whether they are using a TextView and custom fonts, or are drawing on a Canvas, for rendering the RPN stack
Aditya
ok
Mark M.
you can find other calculator apps on the Play Store
Lujop: do you have another question?
Aditya
I will try looking at them..thanks
Lujop
Can I ask another question?
4:45 PM
Mark M.
Lujop: yes
Lujop
I'm using your MergeAdapter
And until now it works very easy an well
I use addView to add some sort of header rows
and addAdapter for data
The problem is that now I need to have a button in some rows that do a row change
the typeOfView of the row is changed
There isn'tsome support for data invalidation, is there?
Mark M.
the type of a row cannot change, regardless of MergeAdapter
AFAIK, that has to be immutable for the life of the adapter
Lujop
Woww....
I supposed I can change with notifyDataSetChanged()
Mark M.
you can give that a try
if changing row types works with ArrayAdapter, and does not work with MergeAdapter wrapping around the ArrayAdapter, file an issue on the project, and I'll take a look at it
but I have never seen that done
4:50 PM
Lujop
Mmm, I've seen some applications
I've seen some applications that have like a page advance button for the row
that when pressed changes the content of the row
Mark M.
just because a row changes visually does not mean that getItemViewType() returns a different value
Lujop
yes, if it doesn't works I will have to play with visibility
or discarding reusedview
Mark M.
or just change the contents of your row view
Lujop
And if I have some sort of expand rows button in the header views and then call notifyDataSetChanged
MergeAdapter will get the new rows from the managed child adapters, won't it?
Mark M.
it should, yes
if not, that is a bug
Lujop
Okey. I will have to play on it then. I connected mainly for the first question.
Mark M.
Aditya: do you have another question?
4:55 PM
Mark M.
do either of you have another question?
Lujop
Yes
I've a last one
In current version app I use a DB that is stored in internal memory
For a future version I'm evaluating to move to SD because the DB is quite big
Aditya
I don't have any questions..Thanks
Lujop
But the problem is that application needs the DB mainly in all places
Mark M.
starting with API Level 11, internal and external storage should share a partition, and so size is less of an issue
Lujop
And I don't know if there is a good centralized way
that I can advice the user that application doesn't work like the phone is connected with usb and sd disconnected
Well, in API11 devices I think that the problem in DB size is minor
Mark M.
can you quantify "quite big"?
Lujop
about 2MB
Mark M.
oh, I really would not worry about that
Lujop
But there are a quite descent number of users complaining about that
Mark M.
and if you move it to external storage, you will have a decent number of users complaining about that (i.e., unavailable when tethered)
5:00 PM
Lujop
But in general is there a good centralized way to catch up if we haven't external storage
Mark M.
you can listen for the broadcast Intents
Lujop
ok
Because also I'm plannig to move some other sort of data to the SD
And application won't work without that.
The idea is then to listen itents and leave a global I_CANT_WORK_BECAUSE_NO_SD state...
Mark M.
you will also need to check the state manually, via Environment, for when your app is started up with a fresh process
and that is it for today's chat
Lujop
Ok I will evaluate that
Mark M.
next chat is Thursday, 10am Eastern Time
have a pleasant day, all!
Lujop
But I think that will be difficult one
Because when receiving state change there can be working threads...
Ok. Thank you Mark
Aditya
has left the room
Lujop
has left the room
Mark M.
turned off guest access

Thursday, July 12

 

Office Hours

People in this transcript

  • Aditya
  • Lujop
  • Mark Murphy