Steve Myers

Ranch Hand
+ Follow
since Dec 08, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
8
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Steve Myers

sam liyanage wrote:I need to transfer data(set of ArrayLists) via activities.I need to do this without database.what is the besatway to do this?
1)Global variable
2)Use Super class
3)Shared variable
4)any other way

please help?



Besides what others have mentioned, making the objects in the list Serializable and writing/reading a file can be effective. This is effective when you need to persist the data even if the app is exited.
10 years ago

Ron McLeod wrote:

Steve Myers wrote:Hi, would anyone like to collaborate on Android apps with me?


PM'ed you a few days back - thanks.



Ron, just saw your post and PM'd you back.
10 years ago
Hi, would anyone like to collaborate on Android apps with me? (any category is fine although mostly not interested in games, although I might be able to be persuaded).

I'm an older CS student (33) looking to change careers at some point, so I'm pretty serious. I'm looking to get some experience programming with others since
everything I have done, I have done alone. I have a few apps in the store, and interested in making quality products that I'm proud to put my name on and increase my skills as much as possible.
Making some ad revenue wouldn't hurt although it is not my primary motivation at this point.

Ideally you would already have some experience with Android, although if you were a Java developer that wanted to learn that would be fine too.
But please be able to put some time in, I have tried this with 3 people so far and they haven't written a single line of code.

Not 100% sure if this appropriate for this forum, but it doesn't seem appropriate for Jobs Forums either since I'm not going to pay you and you're not going to pay me.

Please PM me if you interested, thanks.
10 years ago
I honestly wouldn't spend your time reading a book on XML for Android, it is one of the simpler parts of Android IMO. I just learned it as I went along. You'd be better off reading how the various LayoutParams work for each the ViewGroups and how layout_weight works and such.
10 years ago
Many times Java libs won't work in Android due to missing dependencies and vice versa. You're better off getting an Android specific library and coding directly in the Android environment. Try http://loopj.com/android-async-http/ It solves some Android specific problems which you would have to re-solve if you did manage to get a straight Java library working.
10 years ago
I learned the syntax of Java very well from reading Ivor Horton's Beginning Java - it's a giant tome and he explains every nook and cranny of the language, leaving nothing to the imagination. When I started I had next to no programming experience and this book worked for me.
11 years ago
According to Oracle, JavaFX is replacing Swing as the desktop UI of choice. Swing was never widely used for big name desktop applications, but there have been some exceptions -
I believe LimeWire was one. Eclipse is written in Java but I believe uses the SWT toolkit. I have heard that Swing is used extensively in "Enterprise" applications.

One word of caution - I don't believe JavaFX has a native look and feel yet, so your app will look like it came from outer space on all platforms if you go that route.
It does look like it has more of a future though, there are ports for Android/iOS coming.
11 years ago

Pamela Hendersen wrote:Is there a guide which can tell me exactly when to use the MigLayout and when to not ?



I find that using MigLayout for everything is just easier. It's as easy to use as the simple API layout managers, but far more flexible. It basically combines the functionality of all the simple layout managers into one.

The problem I would run into with the simple API managers is nothing exactly fits into the mold, and you end having to use multiple nested layouts - then getting everything to align
properly and making the window resize properly just gets really messy and difficult.

I ended up rewriting everything with MigLayout, and only use it when I start something new.
11 years ago
MigLayout's is pretty popular, here's where I heard of it - I have had no issues with it so far. Link also has quite a bit of discussion on layout managers in general.
11 years ago

Pamela Hendersen wrote:Can you suggest what might be a good layout for this purpose ? Is it as "simple" as creating a couple of panels for things like key board, display, text fields, drop down menus etc and dumping them into the appropriate layout ?



IMO the eight or so layout managers included in the Swing API are not very good. The fact that there are eight is a clue to this.

I would suggest just starting with the third party MigLayout and saving yourself a lot of headache. I just noticed that it is now ported to JavaFX2 so thats a benefit as well.

It is fairly intuitive and easy to learn, and you can pretty much make any layout by hand with just the one layout manager and a minimum of nested panels.
The only other layout manager you might want to use is CardLayout since its functionality is unique.

Also IMO Swing is fairly straightforward its just tedious and the code to make the GUI is long.
11 years ago

Campbell Ritchie wrote:I am gladyou said, “Please don’t”. What would happen if you had a List<Number> and passed a Comparator<Number> to the sort method?


You can't, my class does not extend Number.

Campbell Ritchie wrote:You will still have problems with Longs with > 15 digits, because their precision can exceed that of a double.


My class doesn't accept Longs.

I'm not saying it's without flaws, it was just an idea - as clumsy as it might be.
11 years ago
I agree with everything that's been said, but I couldn't get this out of my mind for some reason. If you wanted to do something like this for real (please don't), you'd need a method to determine the type of value stored in the wrapper class and proper getters, etc. If you were addings strings that weren't string representations of numbers, you'd have to handle them in the compareTo() method appropriately of course.

11 years ago
Here is a website with specifically what you are looking for: openhatch
11 years ago
You're add method isn't correct, try:



You should carefully read Java docs for the Swing components you're using. Also look at naming conventions - your class name is not capitalized.
One more thing, read up on the Event Dispatch Thread.
11 years ago

Marvin Porte wrote:Problem:
My Question:
i really can't determine the looping condition on how many times I'm going to loop here since there's no specific given and you can't determine somehow (I think..).
so what i did was get the max length (a.length*b.length) then use it as looping condition (but i know that it will not reach to that point. i just make it to make sure that it will loop all the conditions).
then i just created a break point on the loop where counters reach their max value (array length).
is it legal? i mean is it an acceptable code as a programmer? it works fine but i don't know if it's acceptable or a good practice. and can you give me any idea to solve this one if you have an idea for looping condition.



A while loop with no break; statement makes a lot more sense for this for code clarity.



if you wanted to leave the break statement (perhaps there were two separate exit points from the loop):



In your version the for loop is not needed, it's not an exit point, the value of i is not used for anything and its just confusing.

11 years ago