Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
TheReverend
Jun 21, 2005

Hey dudes, I'm coming from an exclusively C# workplace and I'm having some XML issues. In .NET, XML that was formatted like a datatable was pretty easy to sort through, edit columns, add columns, edit rows, delete rows, add rows, etc.

I can't find any nice easy-to-use class within the Android SDK.
Is there anything I'm missing?

Adbot
ADBOT LOVES YOU

TheReverend
Jun 21, 2005

Has anyone here used the In-app Billing with much success? I admit I'm still pretty new to android and that stuff I've done hasn't been too complicated but this In-app stuff seems like a design disaster. I'd have thought it would have been a whole lot easier!

Is it really this complicated, or do I just suck?

TheReverend
Jun 21, 2005

Anybody going to AnDevConIV in San Francisco next week? :rory: :tinsley:

TheReverend
Jun 21, 2005

If it makes you feel better I spend 90 percent of my time making and maintaining a windows mobile 6 app.

TheReverend
Jun 21, 2005

So I'm a .NET ~*Compact Framework*~ developer.

I've been that for the past 7 years oh so (holy poo poo :( ).

Anyways as terrible as WindowsMobile is to use, developing for it was so super easy!
I'm having the exact opposite problem with android. Maybe it's just because it's new to me. Maybe I'm a dumb baby.

Anyways, I request advice on the following things:

1)SQL Lite. I've got the basics down. But one thing I'm going to need to do is read the databases from a desktop application over USB. Any ideas how to do that?

2)UI. The eclipse "designer" sucks poo poo(at least for me. I just want something simple). I really miss Visual Studio when it comes to "form designing". I hate the XML editor. What can I do? Suck it up? Is there a good third party form editor?

3)ListView. I can add stuff to my list view from a database. What I would like to do is also keep track of the unique ID in the database for each item in the listview. But I don't want to display it? Any tips?

4)Why is this so terrible? Is this terrible for everyone else? It took me forever to get a "google maps api for android" sample app running. Not to code it, but to setup eclipse. How does everyone feel about android development in general? I LOVE using android devices but so far I'm not that keen on developing for them.

TheReverend
Jun 21, 2005


Thanks for the tips. I'll definitely check all that out. I'm not sure how well the network thing will do because this will be for "remote farm area" stuff but who knows theres got to be Starbucks around somewhere, right?

TheReverend
Jun 21, 2005

Karthe posted:

"toasts" are little pop-up messages.

:lsd: Oh man I get it now... I feel really stupid. I've been using them for a while and always thought to myself "toast is kind of a random word to use".

TheReverend
Jun 21, 2005

That's a good suggestion but a bit of a technical stretch for our intended users (which is country grandpas).

TheReverend
Jun 21, 2005

I have one more question (and I don't mean to hog this thread, honest!):


-I have a popupwindow and I want to click outside of the window to close it. I found out that setting the popupWindow drawable to an empty drawable will make this happen. I also learned that setting it to null will kill all other UI activity except for the popupWindow.
What I don't understand is...why does this happen?

TheReverend
Jun 21, 2005

I'm haveing an issue with an Exception
code:
 
E/AndroidRuntime(3565): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
So the way my Activity works is that It takes information from a BT sensor and when it receives data it populates a popupWindow where you can edit the data and save it.

If you click on the graphical representation of the data, it populates the popupwindow with the saved data.

I can save new data and view old data just fine until I rotate the tablet. Then I can view data all I like, but new data causes this exception.

For the life of me I can't figure out what's going on.

TheReverend
Jun 21, 2005

RE SQL Lite:

I'm storing coordinates like 83.76832892 into a REAL column in my SQLite DB.
It's coming out rounded a few places like 83.768.

What is going on? REAL is for floating point numbers right?

TheReverend
Jun 21, 2005

Oh okay. That sounds kinda silly though!

It's more like 5 decimal places, but still!

Edit: never-mind I'm dumb and realized I was reading wrong from the cursor.

TheReverend fucked around with this message at 21:36 on Sep 20, 2013

TheReverend
Jun 21, 2005

Ulysses S. Grant posted:

Since nobody is answering you - my bet is that when you rotate your device, the activity is destroyed and relocated, and whatever populates the popupWindow is retaining the Context to the previous instance of the activity. Set your activity to handle rotation by adding android:configChanges="orientation" to its activity declaration in the Manifest and by implementing OnConfigurationChanged() in your activity. Or just have your activity pass along a new Context when it's recreated.

Thanks for the reply.
I should have edited but I fond a solution.
I'd like to share with you though so maybe I can understand better.

So in the background thread I had the popupwindow run with "runonuithread(APredefinedRunnable)".

I got it to work by using a Handler and then using Handler.SendEmptyMessage(0);


I had a bunch of code in OnResume() to specifically handle recreating all threads etc so I'm not sure why Runnable=bad but Handler=good.

TheReverend
Jun 21, 2005

It looks like there are a thousand XML parser classes in Java/Android.
Which one should I use.

Ideally anything approximating a C# style thing like this would be awesome

code:
DataSet ds= new DataSet();
ds.ReadXML("cat.xml");
DataTable table=ds.Tables[0];

Where the xml looks like

code:
<root>
<cat>
<name>SirMeow</name>
<color>Calico</color>
<sex>male</sex>
</cat>
</root>

TheReverend
Jun 21, 2005

I feel like I'm losing my mind.

I had an application I was working on, and when you started it, onstart was called.

When you changed the orientation, onpause and then onresume were called.

All was right with the world.

Now all of a sudden, onstart is being called when the screen oritentation changes.

Any idea what is happening?

TheReverend
Jun 21, 2005

Salvador Dalvik posted:

One thing that changed is that before 3.x, you only had to specify configChange=orientation|keyboardHidden for that hack to work, but now you have to include screenSize for it to have the same effect.
Well that fixed it. I had orientation|keyboard before you told me to add in screensize.


That's really the default behavior though? I thought it was pause-resume for screen changes. That seems undesirable. Or is it desirable and I'm not doing stuff right?

Oh well thank you!

TheReverend
Jun 21, 2005

In my experience that's the essence of bluetooth no matter the flavor.

TheReverend
Jun 21, 2005

Uncomfortable Gaze posted:

Just a heads up: Google IO registration is now open. Signups are open till the 18th, and it's a random drawing instead of the first-come system they had before.

I don't see how much it is. It's usually a lot, yeah?

TheReverend
Jun 21, 2005

kitten smoothie posted:

$900. If you apply for a ticket and are selected, they will automatically charge your credit card.

Oh that's a no brainer then. I'll let my boss know.

TheReverend
Jun 21, 2005

So I needed to work on an Android thing again yesterday. No big deal fire up eclipse, etc. Oh look some android component needs updating, updates, breaks other things, update those, endless cycle.....broken eclipse.

So I redownload the latest eclipse and ADT thing, get that going. Projects are starting to build. The only problem is that graphical editor for the layouts isn't working. It'll display the layout but won't let me add UI elements to it in a drag and drop manner.

So my questions are

1)Am I just being a whiny baby for wanting a visual studio style UI thing? Should it even matter and just "XML or go home"?


2)I know the non-eclipse IDE is "beta" but Google will often leave the beta designation on things that work really reliably (like Maps and Earth for the longest time). So.... are you guys using eclipse still or am I an old fogey and need to get with the times?


I spend like 5% of my time doing Android things so sometimes I get left out in the dust.

TheReverend
Jun 21, 2005

i have to do android project. Coming from IOS this makes me sad.

Is it any easier to do on windows v.s OSX?

I don't care which OS I use. I just want the path of least resistance.

Also, I started android studio, set my target to API 19 but it set my compile sdk to 21 and my build tools to 23 is that right?


I'm in for some...fun?

Adbot
ADBOT LOVES YOU

TheReverend
Jun 21, 2005

Re drivers:

It says my Nexus 6p has API1 on the device list on osx...

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply