Anton Sigurdsson

Greenhorn
+ Follow
since Sep 29, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anton Sigurdsson

Hey.

I have bin playing a round whit rendering in Java like LWJGL.
Its lot of fun.

I like to move to Android and do same 3D.(I think its could 3D Rendering)

I'm looking for a Library where i cane make a good quality 3d looking games like this one her.
https://play.google.com/store/apps/details?id=jp.co.d3p.dreamclock00.amane (Not the Best Example bot close to what i like to make)

I look all over the Internet. its rally hard to find anything java based. or do i need to use C++?

I need 3 thing.
1. A place to Start?
2. I need library whit a good support and easy access to the code and greet quality 3d? (or same greet Game Library for 3D for Android)
3. I rally like to use the models i made in blender? (http://www.blender.org/)

not necessary bot i love if their is support or tutorials or youtube videos for the library to get my started.

I love all the guides you can give.

sorry English is my second.
thanks for all the help.
10 years ago
thanks, the link was greet.
10 years ago
Okay I made a folder on my android phone.
I made a cars.txt in it, and I made a program to read and find the text files.
It works on my PC, it works fine.
Can I use "File" to get the file on the android?

I don't thing I can use "/Starage/sdcard0/Cars/" to find my folder on android.
When i use "My Files"(its on samsung) on my phone i get this. and i made a falder named Cars.
/Starage/sdcard0/Cars/

how can i get ther if its not "/Starage/sdcard0/Cars/"? or is it?!?

Example

Downloads
Pictures
Cars <---
Music

File folder = new File("/Starage/sdcard0/Cars/"); <---- i dont no how to navigate on android.
File[] listOfFiles = folder.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.toLowerCase().endsWith(".txt");
}

Thanks for reading and helping out.



10 years ago
I got a question about the android SDK emulator. Its rally slow and its a royal pain. When I test thing on my phone. Then its fast and smooth. Is my emulator wrongly set up or is it slow.
10 years ago
Thanks. I switch the two lines and it worked.
Its a classic, what came first chicken or the egg?

It looks like this now.
And it works.

Path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);

line over the: file = new File(path, f + ".png");
10 years ago
I thing. The code is missing something!
When I read and wrote the image.
I get massage it saved on the emulator.
Bat no image in image directory
And on my phone noting happened no image save.
10 years ago
Hallo, I'm trying to read and write a file.
If any one haves experience in making a save game futures. I love to get any tips you have to give. I'm so green.
I made this and it is not working. I thing a mist something.

and i only need WRITE_EXTERNAL_STORAGE right? :p

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import android.os.Environment;

public class Save {

private static String state;
static boolean canW, canR;
static File path = null;
static File file = null;

private static void checkState() {

state = Environment.getExternalStorageState();
if (state.equals(Environment.MEDIA_MOUNTED)) {

Variables.text1 = "Can Write = true";
Variables.text2 = "Can Read = true";

canW = canR = true;
} else if (state.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {

Variables.text1 = "Can Write = true";
Variables.text2 = "Can Read = false";
canW = false;
canR = true;
} else {
Variables.text1 = "Can Write = false";
Variables.text2 = "Can Read = false";
canW = canR = false;

}
}

public static void save() {

String f = "car";

file = new File(path, f + ".png");

checkState();
if (canW== canR == true){

path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);

path.mkdirs();

try {
InputStream is = StartGame.ourView.getResources().openRawResource(R.raw.car);
OutputStream os = new FileOutputStream(file);
byte[] data = new byte [is.available()];
is.read(data);
os.write(data);
is.close();
os.close();
Variables.text3 = "Image Saved";

} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}

}


}
}
10 years ago
I'm sorry for bed English.

I got the Event Touch thingy runing. bat my code is not rally good.
is there a batter way of doing this or a right way of doing it?
I'm making a invisible box where i can press the screen, its like a button.

the code is working i thing. when i touch the screen where the y and x i do get respond.
i made the program exit, and then open a other window.

note: I me by using the code in a wrong way. I was having a hard time understanding java in general. im using MotionEvent is that okkay for this?

@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub

x = event.getX();
y = event.getY();

switch(event.getAction()){
case MotionEvent.ACTION_DOWN:

break;
case MotionEvent.ACTION_UP:
if(y > 50 && y < 100 && x > 50 && x < 100){

}
break;
}
return true;
}
10 years ago
Sorry for bed English.

I was trying to find the TouchEvent for my android phone.
Like the MouseEvent, is their same thing like TouchEvent where i can select a cornets on the screen and make a costumed selectable surface?

MouseListener the same things go´s for the is the same thing like TouchListener out there for android?

is it on the list.

I'm sorry if this is not in approved place in the forum.
10 years ago
Thanks for the fast response to my question, and the Arrays links.
10 years ago
sorry for bed english.

is ther any way to make this happen?

i like to get all the names in a list from all my objegts.
i tray to use +counter

pepole pepoleObjegt = new pepole();
-------- this was cut out--------
pepole pepoleObjegt200 = new pepole();

int counter = 0;
while(counter < 200) {
System.out.println(pepoleObjegt+counter.getName()):
counter++;
}

10 years ago
hi.

i got this code this is the draw stuff. its works great bat when i wont to use the list. like new game and load and exit, the are command i mad. it fills the screen. and the list is up in the upper left corner. and its overwrites the display filling the screen whit the list.

what i wont the list to do is to by in the middle of the screen on top of the draw stuff.

Image backGround= Image.createImage("/MenuImage.png");
g.drawImage(backGround, 0, 0, Graphics.TOP | Graphics.LEFT);

i do no this menu overwrites canvas
display.setCurrent(canvas);
display.setCurrent(menu);

is their any way to get the list in the middle of the screen whit out filling the screen or overwrite the nice background using the drawImage in canvas?
12 years ago