Jan 27 | 7:25 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Susheel | has entered the room |
Susheel |
Hi Mark
|
Mark M. |
hello, Susheel!
|
Mark M. |
how can I help you today?
|
Susheel |
Is there a way to transfer database or a textfile from an android device to another device using bluetooth?
|
Susheel |
I am able to establish a connection but I'm wondering how the other device is going to receive the database itself
|
Jan 27 | 7:30 PM |
Mark M. |
if it is running your app, you could use RFCOMM-style communications, as I understand it
|
Mark M. |
but, I haven't messed with Bluetooth as a developer, other than the automatic transfer you get from Android Beam
|
Mark M. |
which, from a programming standpoint, is much more an NFC thing
|
Roy C. | has entered the room |
Susheel |
Yes...I am trying to transfer database from my android device to either a computer or another android device. What methods can I use?
|
Mark M. |
(BTW, hello, Roy -- I will be with you shortly!)
|
Mark M. |
Susheel: are you writing software for both ends of the communications?
|
Susheel |
No sir...
|
Mark M. |
then, I don't really know what to tell you
|
Mark M. |
as you would have to start by defining what is on the end of the communications pipe that you're not writing
|
Susheel |
yes
|
Mark M. |
let me take a question from Roy, and I will be back with you in a bit
|
Mark M. |
Roy: your turn! do you have a question?
|
Roy C. |
Hi Mark I have emailed you directly a couple of times outside of office hours. Thanks for doing this.
|
Mark M. |
yeah, well, that's why I steer you towards common resources like this
|
Jan 27 | 7:35 PM |
Mark M. |
as I really try to avoid offering support by email
|
Jan 27 | 7:35 PM |
Mark M. |
as it is totally non-scaleable
|
Roy C. |
understood
|
Roy C. |
i think it was a problem with downloading from IE
|
Roy C. |
you fixed it or i am not using ie anymore
|
Mark M. |
oh, subscription problems are totally reasonable by email
|
Mark M. |
I was thinking you were referring to Android development support questions
|
Roy C. |
i want to ask you about sharing data between android devices via the cloud
|
Roy C. |
i have purchased Enterprise Android book but the further i get the more heavy weight things become
|
Roy C. |
in the simplest form i want to share date between two or more android devices
|
Roy C. |
so i have device side questions and cloud side questions for you
|
Mark M. |
OK, give me the first one
|
Roy C. |
on the client side i want to share data item x between me and another android device. Lets just make it one data item to make it easier
|
Jan 27 | 7:40 PM |
Roy C. |
i don't need to share data between apps on the device so i want to know if you recommended using the content provider or just sql api
|
Mark M. |
well, neither have much to do with the high-level problem
|
Roy C. |
can you elaborate
|
Mark M. |
as the other Android device will not be talking to a SQLite database or a ContentProvider on your first device
|
Roy C. |
no i understand that
|
Roy C. |
i need the send client me to guarantee that the data is delivered
|
Mark M. |
which also has nothing to do with SQLite or a ContentProvider
|
Mark M. |
you could use either of those, or a JSON database (e.g., Couchbase Mobile), or a JSON file, or an XML file, or a CSV file, or ...
|
Mark M. |
the data representation on one node of your M:N communications does not matter, at a high level
|
Mark M. |
now, particular *implementations* of your communications might prove to be easier if you choose a certain data storage model
|
Mark M. |
but, just saying "I want to share stuff, how should I store it?" isn't going to steer you in the direction of any particular storage solution
|
Jan 27 | 7:45 PM |
Mark M. |
let me take another question from Susheel, and I will be back with you in a bit
|
Mark M. |
Susheel: your turn! do you have another question?
|
EGHDK | has entered the room |
Susheel |
So standard android bluetooth apis support data transfer between two android powered devices? In which case I would be writing software for both ends.
|
Mark M. |
(BTW, hello, EGHDK, I will be with you in a bit!)
|
Mark M. |
Susheel: you should be able to transfer a file via Bluetooth RFCOMM
|
Mark M. |
but, again, I haven't written any Bluetooth stuff
|
Susheel |
Ok. Thank you Mark
|
Mark M. |
that was nice and quick :-)
|
Mark M. |
EGHDK: your turn! do you have a question?
|
EGHDK |
Skip me for now!
|
Mark M. |
OK
|
Mark M. |
Roy: back to you -- do you have another question?
|
Roy C. |
Its the same question
|
Mark M. |
then I guess I do not understand the question
|
Jan 27 | 7:50 PM |
Roy C. |
i am using SQLite on the sending device , i need to send that data up to a cloud backend and have the receiver device pick it up or push it to the receiver via Google cloud services or Parse.com or something
|
Mark M. |
um, OK
|
Roy C. |
i need some advice on sample code or methods to do this as the book has gotten heavy weight with SQLLite , Content Providers, and Sync Adapters to accomplish the transfer
|
Mark M. |
well, there are reasons why that sort of stuff gets covered in books and not in chat rooms... :-)
|
Mark M. |
now, I have not used Parse, and so I do not know all their client library capabilities
|
Mark M. |
but, rolling back to my previous point, saying generically "a cloud backend" is too vague
|
Jan 27 | 7:55 PM |
Mark M. |
as the solution for talking to a Web service would differ from the solution for talking to a git repo
|
Mark M. |
which would be different than using Couchbase Mobile and Couchbase Sync
|
Mark M. |
which would be different than using some sort of pub/sub messaging system like RabbitMQ
|
Mark M. |
and so on
|
EGHDK |
I'm just going to post this here. Just scroll back up to it when it comes back to me? Thanks. So I'm still having some trouble with android studio. Not sure how I feel about intellij. haha. But I was just curious if there was any reason why the android team chose eclipse in 2007 for android?
|
Mark M. |
Roy: so, there's not a lot that I can tell you
|
Roy C. |
I will take a look at couchbase and come back in on a future chat.
|
Mark M. |
OK
|
Mark M. |
EGHDK: to your question, in 2007, Eclipse was the Java SDK leader by a country mile
|
Mark M. |
I don't recall if IDEA existed then, and if it did, it was very much a niche solution
|
Mark M. |
and Eclipse had already blown the doors off of NetBeans
|
Mark M. |
choosing anything other than Eclipse would have been a serious "out of left field" choice
|
Mark M. |
8 years is a long time
|
Mark M. |
Susheel: your turn -- do you have another question?
|
Jan 27 | 8:00 PM |
Susheel |
No Thank you
|
Mark M. |
Roy: do you have another question?
|
EGHDK |
So eclipse and ADT was released in 2007? Or did people have to do android development via cmd line?
|
Mark M. |
EGHDK: I forget exactly when Eclipse/ADT was released
|
Mark M. |
I didn't start using Eclipse until 2010 or so
|
Mark M. |
I worked from the command line originally
|
EGHDK |
Earliest I can see is "(October 2009)" according to here. http://developer.android.com/tools/sdk/eclipse-...
|
EGHDK |
Oh man. cmd line only sounds so miserable.... hahaha
|
Mark M. |
no, it was available before then
|
Mark M. |
I'm pretty sure I mentioned it in my first book edition, which would have been June 2008
|
Jan 27 | 8:05 PM |
EGHDK |
it was available before then? gotcha. Thanks wonder where I can find that. I'm actually curuious
|
Mark M. |
you could try poking through old archives of the android-developers Google Group
|
Susheel | has left the room |
Mark M. |
Roy: if you have another question, chime in
|
Mark M. |
for that matter, if either of you have a question, go right ahead
|
EGHDK |
Seems like 2007. Just went here and searched for eclipse. and it shows up in 2007. Don't think they would have mentioned it if it wasn't meant to be THE android ide http://android-developers.blogspot.com/search?u...
|
Mark M. |
yes, it must have been there at the outset
|
Roy C. |
thanks mark i will check back in with you after i dig into this cloud thing a little more
|
Mark M. |
OK
|
Jan 27 | 8:10 PM |
Roy C. | has left the room |
EGHDK |
So I have this issue where it seems like sometimes I leave my app at ActivityB (via home button), then go into another app, then click app icon. And I end up at activityA.
|
EGHDK |
But then if I go back to activityB again, leave, go into another app, and then go into the app from recents, I end up at activity B.
|
EGHDK |
It's like it doesn't recognize that my task exists.
|
Mark M. |
tasks in Android make my head hurt
|
EGHDK |
and the activity wasn't destroyed and process wasn't killed.
|
Mark M. |
is there anything unusual about either A or B from a manifest standpoint?
|
EGHDK |
A is a launcher.
|
Mark M. |
anything else? android:clearTaskOnLaunch? android:finishOnTaskLaunch? etc.?
|
EGHDK |
Nope... sadly.
|
EGHDK |
It seemed to work fine, but then I updated my app and it keeps behaving like this.
|
Mark M. |
device, emulator, or both?
|
Jan 27 | 8:15 PM |
EGHDK |
My personal device. Seems to work normal on the emulator.
|
Mark M. |
is the "app icon" the launcher icon, or a home screen shortcut that you added?
|
EGHDK |
And I know I know... well the new app that I open in between must be the cause of the activity dying or task being cleared I guess. but idk anymore.
|
EGHDK |
Home screen "shortcut"
|
Mark M. |
try using the icon in the launcher itself
|
Mark M. |
home screen shortcuts can get a bit weird sometimes
|
EGHDK |
True. Okay. I am of course away from my phone now so I'll try that soon when I go upstairs. It led me to this question though. http://stackoverflow.com/questions/28154564/and... Ideas?
|
ErnestG | has entered the room |
Mark M. |
"Is there any debugging tool that I can use to get an inside view of my app/process to see which components (specifically Activities) are in existence?" -- unless that's somewhere buried in adb shell dumpsys output, then now
|
Mark M. |
er, then no
|
EGHDK |
Any way to really see how many activities are alive from my app?
|
EGHDK |
Maybe just tracking them myself?
|
Mark M. |
other than tracking them yourself, not that I am aware of, again outside perhaps of dumpsys output
|
Mark M. |
let me take a question from Ernest
|
EGHDK |
okay. so a dumpsys might contain some info.
|
Mark M. |
Ernest: hello! how can I help you today?
|
Jan 27 | 8:20 PM |
Mark M. |
(EGHDK: Correct. Also, the Novoda demo app is just playing around with its own activities, AFAIK)
|
EGHDK |
Gotcha. I guess thats what I really wanted to know.
|
Mark M. |
ErnestG: do you have a question?
|
Mark M. |
OK, if either of you have a question, go ahead
|
ErnestG |
Just solved my own question. It was in reference to your AS for Eclipse users presentation. Thanks anyway!
|
Mark M. |
OK
|
Jan 27 | 8:25 PM |
Mark M. |
I'm glad that logging into the chat room helped you :-)
|
ErnestG |
Also, @EGHDK I was able to come up with my own solution for tracking activities a while ago. Really helped when figuring out launch mode, and whether or not they were working correctly. Have a good night guys.
|
EGHDK |
Ah damn. Okay. Well, how would I track them. Is onDestroy() basically when I would call an Activity class non existent anymore? or would I have to do a memory analyzer and see how many activity classes their are?
|
Mark M. |
if your minSdkVersion is 14 or higher, you can use ActivityLifecycleCallbacks
|
Mark M. | |
Mark M. | |
Mark M. |
basically, register an ActivityLifecycleCallbacks instance with your Application
|
Mark M. |
you'll get central notification for all lifecycle methods for all activities
|
Mark M. |
and there, you can keep track of what's in what state, from a lifecycle standpoint
|
EGHDK |
Okay so thats good. but I get an Activity back as a param in the callback.
|
Jan 27 | 8:30 PM |
EGHDK |
What would be the best id I can use from an Activity to track it?
|
Mark M. |
off the cuff, I'd go with hashCode()
|
Mark M. | |
Mark M. |
and that's a wrap for today's chat
|
Mark M. |
the transcript will be up on http://commonsware.com/office-hours/ shortly
|
Mark M. |
my Internet connection at this hotel sucks, so I am pushing out the next chat to Monday at 7:30pm US Eastern
|
EGHDK |
At a conference?
|
Mark M. |
teaching a course
|
EGHDK |
Gradle?
|
Mark M. |
Android app development
|
Mark M. | |
EGHDK |
Where can we take a course?
|
EGHDK |
Oh. Okay. Thanks. I'll look into it.
|
EGHDK |
Night!
|
Mark M. |
have a pleasant day!
|
EGHDK | has left the room |
ErnestG | has left the room |
Mark M. | turned off guest access |