Jan 29 | 9:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Ron | has entered the room |
Ron |
Hi Mark
|
Mark M. |
howdy, Ron!
|
Mark M. |
how can I help you today?
|
Ron |
I'm trying to implement socket communications. I
can connect to a port on both 3G and wifi, but can only send/receive
data on wifi. I have Verizon.
|
Mark M. |
I take it that this is not HTTP/HTTPS?
|
Marcin | has entered the room |
Ron |
No, I'm going through port 14444
|
Mark M. |
(BTW, howdy, Marcin -- be with you in a bit!)
|
Mark M. |
it's entirely possible that Verizon is doing some proxying/filtering/whatnot that is interfering
|
Jan 29 | 10:00 AM |
Mark M. |
that's not exactly my area of expertise, though
|
Marcin |
Hi guys
|
Mark M. |
the downside of your scenario is that it is
difficult to create a sample app demonstrating the issue, as it relies
upon some server somewhere speaking some protocol
|
Mark M. |
I presume that it is the same code that works on WiFi and fails on Verizon -- correct?
|
Ron |
OK, thanks anyway. The iphone app seems to do the job OK. Not sure of the carrier.
|
Ron |
Yes, same code, only changed the phone setting.
|
Mark M. |
yeah, that's more likely than not to be tied to the carrier, not something specific to Android or your device
|
Ron |
So a carrier can let connects go through, but not I/O?
|
Mark M. |
well, you might not be connecting to the actual target server
|
Mark M. |
you might be connecting to some proxy that Verizon is running
|
Mark M. |
is it possible for you to temporarily reconfigure the server to use port 80 or some other normally-open port?
|
Mark M. |
if so, try that and see what the behavior is on Verizon
|
Mark M. |
also, I presume that the IP address you are connecting to is on the public Internet -- correct?
|
Ron |
There is an app called TCP port scanner, you input
the dns address and port, it tells you whether it is open. I show open
for the address, port 14444
|
Jan 29 | 10:05 AM |
Mark M. |
that simply means that the port scanner app thinks it is open
|
Mark M. |
again, it might not be your server, but some Verizon proxy
|
Mark M. |
does the server in question host anything else, such as a Web site?
|
Ron |
No, but it works fine on wi-fi.
|
Mark M. |
again, if the only thing different is that you are talking over Verizon's network, the problem is most likely with Verizon
|
Mark M. |
let me take a question from Marcin, and I will swing back to you in a bit
|
Mark M. |
Marcin: do you have a question?
|
Marcin |
yes
|
Marcin |
I have a listview with Touch listener
|
Marcin |
inside onTouch().. switch : ACTION_MOVE
|
Marcin |
i have this code
|
Marcin |
View paste
|
Marcin |
the problem is the artefacts like this : http://www.youtube.com/watch?v=kK6s6DKkNC8
|
Jan 29 | 10:10 AM |
Marcin |
what is interesting is that when I uncoment a line code "setAlpha" and set some value 0-1 it works
|
Mark M. |
I cannot speak specifically to your problem
|
Marcin |
if I set a static value of 1.0f it gives same artefacts. Probably due to view reuse
|
Mark M. |
however, there are existing implementations of swipe-to-dismiss
|
Mark M. | |
Marcin |
I have them working
|
Mark M. | |
Marcin |
the issue that I am trying to solve is an item gradually changing color
|
Mark M. |
I'd see how they do it, if they do not exhibit the same problem
|
Marcin |
to red when you swipe it left
|
Marcin |
to green for right
|
Mark M. |
:: shrug ::
|
Mark M. |
again, I do not know what to tell you
|
Mark M. |
my apologies for not being able to help you with this issue
|
Mark M. |
Ron: do you have another question?
|
Ron |
Is there a developer forum or support mechanism specific to Verizon?
|
Mark M. |
not that I am aware of, but I have not gone looking for one, either
|
Jan 29 | 10:15 AM |
Ron |
Then I'm all set for now. Thanks.
|
Mark M. |
OK
|
Mark M. |
Marcin: do you have another question?
|
Mark M. |
OK, well, if either of you come up with a question, chime in
|
Jan 29 | 10:20 AM |
Marcin |
Mark, maybe I will ask this questiona differently so that you can help me
|
Mark M. |
you are welcome to try! :-)
|
Marcin |
I am using Roman Nurik implementation
|
Marcin |
your first link
|
Anantha K. | has entered the room |
Mark M. |
Marcin: OK
|
Anantha K. |
Hi
|
Marcin |
line 277 in SwipeDismissListViewTouchListener.java
|
Mark M. |
(Anantha: hi! I will be with you shortly!)
|
Marcin |
this is where I try to change the background color of swipred item
|
Mark M. |
if (mSwiping)
|
Marcin |
detecting by deltaX
|
Anantha K. |
How to get Phone number of a device?
|
Mark M. |
(Anantha: hi! I will be with you shortly!)
|
Anantha K. |
Sure, thanks!
|
Marcin |
and trying to apply it like that
|
Marcin |
mDownView.setBackgroundColor(Color.argb(255, intFactor, 255, intFactor));
|
Marcin |
it works
|
Marcin |
but only if setAlpha is also called
|
Marcin |
if i comment out the setAlpha line then it gives artefacts like in video
|
Marcin |
intFactor - is a value i calculate depending how deep is the swipe (its calculated properly)
|
Jan 29 | 10:25 AM |
Marcin |
Im thinking that setAlpha is somehow refreshing a list item so it shows up properly
|
Mark M. |
what device were you testing this on, and what version of Android is it running?
|
Marcin |
4.0.4
|
Marcin |
s2 galaxy
|
Mark M. |
you might try disabling hardware acceleration
|
Marcin |
can i do it from code?
|
Mark M. |
ummmm... I think so, but my memory is fuzzy... hold on...
|
Mark M. |
ah, yes
|
Mark M. |
myView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
Mark M. |
though I am not certain if you can reverse it via code -- the docs are a bit fuzzy on that point: http://developer.android.com/guide/topics/graph...
|
Marcin |
ok will try that
|
Mark M. |
if that helps, that indicates a bug in Android itself, in which case a sample project posted to http://b.android.com might help get it fixed for the future
|
Mark M. |
let me take Anantha's question
|
Mark M. |
Anantha: in general, you cannot get the phone number of the device
|
Marcin |
thanks
|
Mark M. |
the device does not need to know its phone number to work
|
Anantha K. |
oh!
|
Mark M. |
while TelephonyManager has getLine1Number(), the result can be null or an incorrect value
|
Jan 29 | 10:30 AM |
Mark M. |
I know of no reliable means to determine the phone number of the device
|
Anantha K. | |
Mark M. |
and, of course, not all Android devices are phones
|
Anantha K. |
yes, got it
|
Mark M. |
see the 31-upvoted comment of mine on the accepted answer :-)
|
Anantha K. |
Yes, I saw :)
|
Anantha K. |
I have another question
|
Mark M. |
since the others have had a couple of questions already, go ahead
|
Anantha K. |
When should one go for GCM? For e.g) how does Airdroid works? using local server right? can the same be developed using GCM?
|
Anantha K. |
I mean without actually running local server on device
|
Mark M. |
Airdroid uses WiFi, as is noted on the Airdroid home page
|
Mark M. |
GCM is not appropriate for this problem set
|
Mark M. |
GCM is not guaranteed, has significant latency, and has only a 4K payload per message
|
Anantha K. |
Can you give me one e.g where GCM is appropriate
|
Mark M. |
Remember the Milk, an online to-do Web app, uses
GCM to push changes made via the Web app to your device that is running
the Remember the Milk app
|
Jan 29 | 10:35 AM |
Mark M. |
to keep the two environments (online plus on-device/offline) in sync
|
Mark M. |
Gmail uses GCM to tell the on-device app about new mail
|
Mark M. |
etc.
|
Anantha K. |
nice,
|
Mark M. |
Marcin: do you have another question?
|
Marcin |
yes
|
Marcin |
I have a listview, I would like to add glow effect on the sides - so that it is always there (like blue glow effect on the top)
|
Marcin |
any ideas how to approach this?
|
Mark M. |
not a clue
|
Marcin |
ok
|
Mark M. |
background image for the ListView, perhaps
|
Mark M. |
Ron: you indicated you didn't have any other questions -- if you come up with one, chime in
|
Mark M. |
Anantha: do you have another question?
|
Jan 29 | 10:40 AM |
Mark M. |
OK, if anyone has any questions, just ask
|
Marcin |
I have a question
|
Marcin | |
Mark M. |
first, are you sure that this is tied to setRetainInstance(true)?
|
Mark M. |
somebody was complaining on StackOverflow recently
about leaks with Maps V2, and I don't recall setRetainInstance(true)
being part of that discussion
|
Mark M. |
specifically: http://stackoverflow.com/questions/14523949/goo...
|
Marcin |
yes, I have tested multiple times with / without setRetianInsance
|
Marcin |
it is only leaking like that when it is set to "true"
|
Jan 29 | 10:45 AM |
Mark M. |
the I suspect that the answer is "do not use setRetainInstance(true)"
|
Mark M. |
er, that should have been "then I suspect..."
|
Mark M. |
it's not like we can change, or even look at, the internal implementation of Maps V2
|
Mark M. |
I will try sometime in the next week or so to reproduce your problem
|
Marcin |
ok, just to be clear, there is no official doc from goole saying i shouldnt right?>
|
Mark M. |
I have not seen one
|
Marcin |
ok, thanks
|
Mark M. |
but, the docs have issues
|
Marcin |
yup
|
Mark M. |
for example, you need ACCESS_PHONE_STATE, and that's not documented
|
Mark M. |
sorry, ACCESS_NETWORK_STATE
|
Mark M. | |
Mark M. |
so, an undocumented limitation with setRetainInstance() would not shock me
|
Marcin |
you should be able to reproduce it with simplest SupportMapFragment
|
Mark M. |
OK
|
Mark M. |
if anyone has any other questions, go ahead and ask
|
Jan 29 | 10:50 AM |
Marcin |
regarding my first question
|
Marcin |
it works much better
|
Anantha K. | has left the room |
Marcin |
if I apply mList.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
Marcin |
its not that smooth though
|
Mark M. |
try it on just the list row
|
Mark M. |
and, yes, it will probably be less smooth
|
Mark M. |
but the point of this experiment is simply to determine if your artifacts are caused by hardware acceleration
|
Mark M. |
if it also happens to give you a production-grade workaround that you prefer over, say, setAlpha(0.9f), that's a bonus
|
Marcin |
on listItem it works worse
|
Marcin |
but still better than original
|
Mark M. |
"worse" meaning sluggish, or "worse" meaning more artifacts?
|
Marcin |
sorry, artefacts
|
Marcin |
I tried hack with 0.9/1.0 alpha
|
Jan 29 | 10:55 AM |
Mark M. |
OK, did you get artifacts with disabling hardware acceleration on the whole list?
|
Marcin |
but cant remember the results .. checking..
|
Marcin |
no artefacts on the listitem.. but listview bg behind swiped item was flickering a bit
|
Marcin |
where can i find out more info about behaviour on software/hardware accel ?
|
Marcin |
in context of this specific problem
|
Mark M. |
well, probably nowhere with regards to this specific problem
|
Marcin |
:)
|
Mark M. |
in general, Romain Guy and Chet Haase have done presentations on this
|
Marcin |
google io video?
|
Mark M. |
check the 2012 Google I|O conference videos (and maybe 2011, though some of that would be dated)
|
Mark M. |
with regards to the flickering, that might be an overdraw issue
|
Mark M. | |
Marcin |
thanks Mark
|
Jan 29 | 11:00 AM |
Mark M. |
and that's a wrap for today's chat
|
Jan 29 | 11:00 AM |
Mark M. |
the transcript will be posted shortly to http://commonsware.com/office-hours/
|
Mark M. |
the next chat is Friday at 4pm Eastern
|
Mark M. |
have a pleasant day, all!
|
Marcin |
bye!
|
Ron | has left the room |
Marcin | has left the room |
Mark M. | turned off guest access |