Office Hours — Today, December 3

Wednesday, November 27

Dec 3
7:20 PM
Mark M.
has entered the room
7:25 PM
Mark M.
turned on guest access
7:30 PM
Liam G.
has entered the room
Mark M.
hello, Liam!
how can I help you today?
Liam G.
Hey Mark.
I hope all is well
I am trying to work on a new bubble game and am trying to figure out the best way to structure it
Mark M.
I recommend a round structure
:-)
Liam G.
Haha.
To keep it simple the game will be like a candycrush
and I am using surface view
my problem is organizing the bubbles and their interaction
Mark M.
note that I am the one remaining person on the planet who has not played, or even seen, Candy Crush
7:35 PM
Liam G.
Ha. Well actually it could be thought of as tetris with bubbles.
Mark M.
OK
Liam G.
i was trying to arrange with a double array
but my problem is the bubbles are different sizes
so i am running into issues figuring out when they are touching and etc.
i guess my main question is
is there a class that handles geometric interaction?
i.e. i create two circles.
are they touching
Mark M.
not in the standard Android SDK
at least, not that I can think of
Liam G.
Well that is unfortunate!
Mark M.
are you using any sort of 2D game library?
Liam G.
I am just drawing everything on a seperate thread using canvas
Is that a decent way of doing it?
Mark M.
well, there's probably nothing wrong with it
AFAIK, many games on Android are built on top of an existing game library, whether for 2D or 3D
Liam G.
okay, any library you would recommend checking out?
Mark M.
I am not a game developer, and so I have never used them
7:40 PM
Liam G.
okay, no problem!
I will do some trusty google searches. I appreciate the input
Mark M.
I would expect that those sorts of calculations would be handled by a game library as part of their physics package
Liam G.
Yeah, that sounds like an easier way of doing it versus all myself...
Mark M.
after all, it's a common problem (e.g., bullets hitting targets)
Liam G.
yeah good point
Mark M.
the library may help with some of the Android idiosyncracies as well
Liam G.
perfect.
Mark M.
some game libraries are designed to be cross-platform, others (e.g., AndEngine) are Android-specifi
er, -specific
Liam G.
okay. Got ya. That is all for me today. I really appreciate the help.
Mark M.
happy to be useful!
noridge
has entered the room
Mark M.
hello, noridge!
Liam G.
Happy holidays.
noridge
Hi
Mark M.
Liam: and to you as well!
noridge: your turn! do you have a question?
noridge
I have an imageview
View paste
<ImageView
        android:id="@+id/imageView1"
        android:layout_width="5dp"
        android:layout_height="fill_parent"
        android:background="#CC00FF00"
        android:padding="5dp" >
    </ImageView>
This displays a vertical bar that is kinda green in color
I want the user to be able to touch and drag this green line
this line since it is 5dp is too difficult to touch
7:45 PM
noridge
adding a padding of 5dp all around doesnt seem to make this view big enough to be easily touched
I would like this imageview to look like it is 5dp but big enough so that it can be easily touched
how do I do this?
Bob R.
has entered the room
Bob R.
Hi Mark
Mark M.
(BTW, hello, Bob -- I will be with you shortly!)
noridge: first, I'd recommend that you consider using an existing library that handles this: https://github.com/MobiDevelop/android-split-pa...
rather than rolling it yourself
that being said, I know that the solution involves using TouchDelegate: http://developer.android.com/reference/android/...
however, I have not had a chance to use that yet personally
basically, a TouchDelegate expands the "footprint" of a View in terms of which touch events it receives
Bob R.
sure. I just finished publishing my 2 new apps on Google Play Store and on Amazon android app store, Now I'm looking for ways to market what I did.
Mark M.
(BTW, hello, Bob -- I will be with you shortly!)
noridge
ohok touch delegate - looks promising
lemme try
Mark M.
noridge: I would poke around and look for samples of the use of TouchDelegate to see if that helps, plus look at the library that I mentioned
your original approach should work, though 15dp itself is not that big
that's like 0.1"
the problem with increasing the padding is that this has a visual effect, in addition to the touch effect
7:50 PM
Mark M.
TouchDelegate lets you handle the touch separate from the visuals
7:50 PM
Mark M.
BTW, you could use View instead of ImageView, if you are not putting an actual image in the ImageView
noridge
ohok thanks Mark lemme try it out
Mark M.
let me take questions from the others, and I'll swing back to you in a bit
Bob: marketing is not really in-scope for this chat
do you have an Android development question?
Bob R.
OOps sorry
OK
I have a question that I saw similar answers on stackoverflow but the code there doesnt seem to work. I used a workaround so that I could publish my apps.
I have a question that I saw similar answers on stackoverflow but the code there doesnt seem to work. I used a workaround so that I could publish my apps.
I have a question that I saw similar answers on stackoverflow but the code there doesnt seem to work. I used a workaround so that I could publish my apps.
Is there an area on stackoverflow where you can answer my question?
Is there an area on stackoverflow where you can answer my question?
7:55 PM
Bob R.
I only know where my homepage is
I only know where my homepage is
Mark M.
this chat is for programming questions
Bob R.
OK
Mark M.
so, you're welcome to ask your question here
you are also welcome to ask it on StackOverflow
however, there are lots of questions on StackOverflow, and I do not see them all, let alone read them all, let alone answer them all
if you do not have your question ready now, that's fine, you can ask it in a future chat
if you do not have your question ready now, that's fine, you can ask it in a future chat
Bob R.
OK for text edit fields, I discovered that if the user doesnt enter text in there the program puts null characters in those fields, then the file wont open. as a workaround I added default values to those fields
OK for text edit fields, I discovered that if the user doesnt enter text in there the program puts null characters in those fields, then the file wont open. as a workaround I added default values to those fields
Do you have a specific example
Do you have a specific example
OK for text edit fields, I discovered that if the user doesnt enter text in there the program puts null characters in those fields, then the file wont open. as a workaround I added default values to those fields
Mark M.
I think that you may be talking about some other platform
I think that you may be talking about some other platform
Bob R.
Im sure theres a better way to handle this.
Im sure theres a better way to handle this.
Mark M.
an EditText widget should return the empty string for getText().toString()
an EditText widget should return the empty string for getText().toString()
an EditText widget has nothing to do with files
Bob R.
no android java on eclypse
the fields are saved to the file
with the rest of the records
Mark M.
and it is your job to make sure that the file is correct
if you do not like what the EditText has, it is your job to correct it when you write the data to the file
8:00 PM
Mark M.
if you do not like what the EditText has, it is your job to correct it when you write the data to the file
8:00 PM
Mark M.
if you do not like what the EditText has, it is your job to correct it when you write the data to the file
if you do not like what the EditText has, it is your job to correct it when you write the data to the file
if you do not like what the EditText has, it is your job to correct it when you write the data to the file
testing...testing...
Bob R.
correct, so if there is nothing entered, I enter a default text for them
Mark M.
OK
(sorry for the "testing" bit, was having a hiccup with the chat room)
I guess then that I do not understand your question
Bob R.
No problem
Can I display one of the pictures I posted on the stores?
Screenshots
Mark M.
there's an "Upload a file" link on the right
Bob R.
ok
Mark M.
while you are doing that, let me take questions from the others, and I will be back with you shortly
Liam: do you have another question
?
Liam: do you have another question
Bob R.
Mark M.
noridge: do you have another question?
noridge: do you have another question?
noridge: do you have another question?
noridge: do you have another question?
noridge: do you have another question?
Bob R.
OK Now I have 2 text fields here. If its blank, I put a default value there.
8:05 PM
Bob R.
Otherwise the program wont open the internal file the next time the program is ioened,
Im not advertising this I'm just reying to get answers. Thanks,
Mark M.
Bob: but you have not asked a question
what is your question?
Bob R.
Is there a way to save the record when nothing is in the fields?
Mark M.
presumably
that is up to you, in your code when you "save the record", whatever that means
Bob R.
I check for null char and add the default text when nothing is entered
Mark M.
that is up to you, in your code when you "save the record", whatever that means
Bob R.
nukk
null
Mark M.
there is no such thing as "null char" in Java
Bob R.
null
sorry
Mark M.
the string may be empty (length of 0)
Bob R.
the error msgs say null
Mark M.
that is still not a "null char"
that is still not a "null char"
that is still not a "null char"
8:10 PM
Bob R.
when the string, the file wont open and it points to null char
when the string, the file wont open and it points to null char
I actually check for null char
Mark M.
there is no such thing as a "null char" in Java
there is no such thing as a "null char" in Java
Bob R.
my workaround is working
OK. I must be missing something.
OK. I must be missing something.
Thanks
Thanks
have a nice evening
have a nice evening
Mark M.
if anyone has a question, go ahead
if anyone has a question, go ahead
Bob R.
has left the room
8:30 PM
Mark M.
that's a wrap for today's chat
the next one is 10am on Thursday
the chat transcript will be archived on http://commonsware.com/office-hours shortly
have a pleasant day!
have a pleasant day!
Liam G.
has left the room
noridge
has left the room
Mark M.
turned off guest access

Wednesday, November 27

 

Office Hours

People in this transcript

  • Bob Richardson
  • Liam Golightley
  • Mark Murphy
  • noridge

Files in this transcript