Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

John Quach

Ranch Hand
+ Follow
since Sep 28, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
32
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Quach

This is what I want. Let's say there are three networks in range. Network A, B, and C. The app finds these networks and prints out only the strongest network...which is Network A. Once printed out, A is now ignored. The next time the app scans for networks, if it comes across network A again, it is ignored and declares Network B to be the strongest. My problem is that Network A continues to be printed out over and over and over again.

Every attempt to try and ignore previously used networks have failed. I tried using another list and adding used networks to it so that it won't be used again.

Either it crashes, or it continues to use the best network without the app ignoring it.

7 years ago
Ok, it's working again. It's loading all the Wifi networks into a List, then it looks for the best Signal Strength. When the player presses "Search Town", it'll say in a Toast, "Found food and ammo at StarBucksWifi town". StarBucksWifi town is a wireless network with the best signal strength.

Now I want to make it so that when the player "gathers ammo and food" at Starbucks, the game will then ignore StarBucksWifi and find the strongest Signal Strength that isn't on an Ignore List. I've tried to figure this out myself, but I am at a lost.

Here's the code that worked.




7 years ago

Ulf Dittmer wrote:What does this code do now, what do you still want it to do, and where are you stuck implementing the missing parts?



Ok I've updated my opening post.
7 years ago
Hello, I'm trying to create an app that scans for wifi. When the player does something in the game, it "consumes" the strongest wifi signal. That signal should no longer be detected on the next scan.

Anyone whos played Metal Gear Solid Portable ops would know what I mean.

I've spent a good 8 hours today trying to do this and now I'm lost.

The plan was to have the Briefing class load first. The Briefing Class looks for wireless signals after the player clicks the button "Search Town". It then returns the strongest wifi signal and it is ignored forever after scanning for Wifi again. The next the player clicks "Search Town", if the strongest signal happens to be the one scanned before, it is ignored and the second strongest signal is considered. Then that is ignored, and so on and so on. I tried to do this by creating a List of Wireless Signals that have already been scanned.

But its one problem after another. The Briefing class loads successfully, but when I click "Search Town", the app crashes.

Please help.



7 years ago
Hi! I just read this excerpt from a blogger in the link below and I'm trying to make sense out of it.

http://saigeethamn.blogspot.com/2009/08/android-developers-tutorial-for.html

Intents are messages that are passed between components. So, is it equivalent to parameters passed to API calls? Yes, it is close to that. However, the fundamental differences between API calls and intents' way of invoking components is
1. API calls are synchronous while intent-based invocation is asynchronous (mostly)
2. API calls are bound at compile time while intent-based calls are run-time bound (mostly)



From what I can tell, the API calls are calls directly from the Java classes itself.
1. The CPU needs to focus all its attention on API calls. I know Synchronization is necessary in games to prevent coordinate variables from getting mixed up with other variables. Is this the same concept?
2. I never fully understood compiling and run-time. From what I can tell, the API calls while its being built up and Intent calls are fired while the program is executing.

Please tell me if any of that or all of that is wrong.

Thank you.
8 years ago
I've looked into LogCat. It's a console for Android from what I've read. But it's off of the emulator.

So far, I've done all my testing on an Android phone because I don't have a computer powerful enough to emulate Android. Is it possible to use Logcat on Eclipse with these conditions?
8 years ago

Mayu Mayooresan wrote:What is the error message you get in the Logcat?? Please share the error.



I'm just checking in before going back to work. I'm sorry, I don't know what a logcat is. I'll look that up when I have free time.

But thank you for the post.
8 years ago
Hello everyone.

This is my first Android app and I'm applying what I've learned so far into this project.

Its a simple calculator for people shopping at a grocery store. Users can add goods to the grocery cart and punch in
the price on the app to keep track of their grocery budget and not go over it.

The app basically stores the output as a String. And when it comes time to do any calculation, the Strings are changed
into Doubles and then changed back into Strings to be displayed.

I think the String converting to numbers and back again are part of the problem along with that If statement.

The app loads the splash screen and the switches to another Activity that is the Calculator. The calculator loads just fine,
but if any button is pressed, the App will crash. I tried to figure it out for hours, but here I am now. Please help. Any
input would be greatly appreciated.!



[/code]
8 years ago
Thank you for the link.

But they seem to be restricted to "proprietary" apps and they can' access the Apps market. I'm looking into getting other tablets and I may just have to save up for several months.

I do have a couple questions:

- Do I need a higher version of Android?

- And will any Android device "allow" me to test my apps on it? I've looked into Iphone development and they come with some strings attached (50 bucks a year).
8 years ago
It seems to me Android has to be a phone. It cannot be a small little tablet.

But there IS an Android tablet is there? Similar to how Ipod Touch is to Iphone?

The reason I ask is because I don't have a computer powerful enough to emulate Android and I cannot afford a monthly plan for an Android phone at this time. I heard that installing Linux on this netbook of mine would be able to emulate Android much faster than Windows 7 Starter which I have. But I don't want that.

Until recently, I've given little interest to these tablets that everyone seems to be using. That changed when I read into developing for Android. But in order to one day create popular apps, I need to immerse myself into this market.

So is there an Android tablet thats like an Ipod Touch?
8 years ago
And for future references, is there a way to search for symbols like this on a search engine? I type "<< java" and nothing relevent pops up.
8 years ago
Developing Games in Java by David Brackeen

In earlier demos in the book, the sprite's position was relative to the screen, but in this game, the sprite's position is relative to the tile map. You can use the TileMapRender.tilesToPixels() static function to convert tile positions to pixel positions in the map. This function multiplies the number of tiles by the tile size:

int pixelSize = numTiles * TILE_SIZE;

This way, sprites can move around to any position in the map and don't have to be justified with the tile boundaries.





I think I have some idea of this concept. But I'm still lost after a few days of trying to figure it out.
8 years ago

Campbell Ritchie wrote:That looks a clumsy way to exit a loop. If you are reading, you can read in a while loop.
You ought to be catching the exceptions from your reader.
You ought to close the reader in a finally block, which you can find if you search this forum.
You can set a while loop to read every line, but it is syntax you would never have guessedIs that straight from the tutorial? I hope you are not paying for it



Yes it is. And no I did not pay for it.

8 years ago
Yes. That excerpt from the program in the book did compile.

I got the source code from this website and I bought the book its based on.

http://www.brackeen.com/javagamebook/

I don't understand. Is it the consensus of this forum that just having a plain boolean value as a condition is bad practice? If so, why is this code written like this?

8 years ago

Jesper de Jong wrote:You mean like this?

It means that the body of the if-statement is always executed. It's ofcourse unnecessary to write code like that. I don't know why anyone would want to write code like that. Can you ask the people who wrote that code why they did this?



I got this from a tutorial on making java based video games. There's a text file with characters that build a game map and this code parses each char into a tile image or sprite.

So the conditional just loops if it has just the "true" statement?

8 years ago