Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Android Driver Station (http://www.chiefdelphi.com/forums/showthread.php?t=129073)

raystubbs 23-05-2014 11:03

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387071)
With the newest version (from both repos) the app crashes when I try to launch it.

Here's the log from the Binary from the Source repo:
05-23 10:35:48.082 E/AndroidRuntime(4855): java.lang.RuntimeException: Unable to resume activity {com.example.driverstation/com.example.driverstation.MainActivity}: java.lang.NumberFormatException: Invalid int: "30-80"

Also, I downloaded the source and am going to look at getting the video feed working for you.

Thanks for letting me know, this should be easy to fix.

raystubbs 23-05-2014 11:33

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387071)
With the newest version (from both repos) the app crashes when I try to launch it.

Here's the log from the Binary from the Source repo:
05-23 10:35:48.082 E/AndroidRuntime(4855): java.lang.RuntimeException: Unable to resume activity {com.example.driverstation/com.example.driverstation.MainActivity}: java.lang.NumberFormatException: Invalid int: "30-80"

Also, I downloaded the source and am going to look at getting the video feed working for you.


I don't get this error, could you try re-installing the app. Sorry, I don't know what else to do since I can't work on a problem I don't have. On second thought, what type of device do you have? If it is a problem with the UI that it could be specific to the screen-size. I will launch the app on an emulator of a smaller screen and see what I can find out.

raystubbs 23-05-2014 11:40

Re: Android Driver Station
 
Quote:

Originally Posted by raystubbs (Post 1387080)
I don't get this error, could you try re-installing the app. Sorry, I don't know what else to do since I can't work on a problem I don't have. On second thought, what type of device do you have, if it is a problem with the UI that it could be specific to the screen-size. I will launch the app on an emulator of a smaller screen and see what I can find out.

I tried the app on and emulator and it works fine. I'm actually baffled by this error being in both apps since in the second one I don't have any integers or any code that used integers. But in the first version I can see where this error could come from, but since I don't get the error I can't investigate.

Maybe it is a version error, try uninstalling the app, and re-downloading it maybe? If you do this I would suggest redownloading the second app (Android-FRC-Driverstation).

dmaciel10123 23-05-2014 11:40

Quote:

Originally Posted by raystubbs (Post 1387080)
I don't get this error, could you try re-installing the app. Sorry, I don't know what else to do since I can't work on a problem I don't have. On second thought, what type of device do you have, if it is a problem with the UI that it could be specific to the screen-size. I will launch the app on an emulator of a smaller screen and see what I can find out.

I'll reinstall again and check for any errors. I have a Samsung Galaxy S3.

Edit: I think it may be because of the network I'm connected to. The IP I was assigned had 3 characters in the 3rd portion of the IP. I changed my network settings and it was able to start normal.

raystubbs 23-05-2014 12:24

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387082)
I'll reinstall again and check for any errors. I have a Samsung Galaxy S3.

Edit: I think it may be because of the network I'm connected to. The IP I was assigned had 3 characters in the 3rd portion of the IP. I changed my network settings and it was able to start normal.

O, yea, that would do it, it's strange to have characters in an ipv4 IP (I didn't anticipate it), I have only ever heard of them in ipv6 and mac addresses.

dmaciel10123 23-05-2014 14:25

Quote:

Originally Posted by raystubbs (Post 1387085)
O, yea, that would do it, it's strange to have characters in an ipv4 IP (I didn't anticipate it), I have only ever heard of them in ipv6 and mac addresses.

Sorry not characters, integers. The IP was xx.xx.xxx.xx instead of xx.xx.xx.xx. The three integers being in the 3rd quarter of the IP messed it up.

Also, I was messing around and added some simple code that may be able to display video but I can't test it yet because I don't have a robot or IP camera. I'll test it probably tomorrow at BattleCry.

raystubbs 23-05-2014 14:38

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387103)
Sorry not characters, integers. The IP was xx.xx.xxx.xx instead of xx.xx.xx.xx. The three integers being in the 3rd quarter of the IP messed it up.

Also, I was messing around and added some simple code that may be able to display video but I can't test it yet because I don't have a robot or IP camera. I'll test it probably tomorrow at BattleCry.

Could you upload the code to the repo please? I have access to a robot right now and could test the code.

dmaciel10123 23-05-2014 15:11

Quote:

Originally Posted by raystubbs (Post 1387106)
Could you upload the code to the repo please? I have access to a robot right now and could test the code.

Sure. Give me a few minutes so I can get my hands on a computer. I've been using my phone all day.

Edit: wow okay whoops. I dun goofed. Just tried opening it with the code I added and it crashed immediately. I'll keep working on it.

raystubbs 23-05-2014 15:44

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387108)
Sure. Give me a few minutes so I can get my hands on a computer. I've been using my phone all day.

Edit: wow okay whoops. I dun goofed. Just tried opening it with the code I added and it crashed immediately. I'll keep working on it.

Are you using VideoView? What I've tried is:

Code:

video = (VideoView)findViewById(R.id.video);

// Set uriString to "rtsp://10.xx.yy.11/axis-media/media.3gp"
String uriString = "rtsp://" + "10." + Integer.toString((addr & 0xff0000)>>16)  //"rtsp://10.xx.yy.11/axis-media/media.3gp"
        +"."+ Integer.toString((addr & 0xff00)>>8) + ".11/" + "axis-media/media.3gp"; 

video.setVideoURI(Uri.parse(uriString));
video.requestFocus();
video.start();

Nothing happens for a while, but then a dialog comes up and says that it can't play the video.

dmaciel10123 23-05-2014 16:11

Quote:

Originally Posted by raystubbs (Post 1387114)
Are you using VideoView? What I've tried is:

Code:

video = (VideoView)findViewById(R.id.video);

// Set uriString to "rtsp://10.xx.yy.11/axis-media/media.3gp"
String uriString = "rtsp://" + "10." + Integer.toString((addr & 0xff0000)>>16)  //"rtsp://10.xx.yy.11/axis-media/media.3gp"
        +"."+ Integer.toString((addr & 0xff00)>>8) + ".11/" + "axis-media/media.3gp"; 

video.setVideoURI(Uri.parse(uriString));
video.requestFocus();
video.start();

Nothing happens for a while, but then a dialog comes up and says that it can't play the video.

I'm actually trying to load the image that the Axis Camera saves at image.jpg and set it as the background at about 30 fps

raystubbs 23-05-2014 16:18

Re: Android Driver Station
 
What is the full uri (path) of the image file? I thought of using the image before. I knew the axis had one I just didn't know where it was.

dmaciel10123 23-05-2014 16:33

Re: Android Driver Station
 
I'm pretty sure it's just http://10.xx.xx.11/image.jpg
I may be wrong, but I do have a code that theoretically will work. I just can't test it yet. I uploaded the code to a forked repo at https://github.com/crazyman10123/And...-Driverstation
I didn't upload a new binary, just the code.

raystubbs 23-05-2014 16:54

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387126)
I'm pretty sure it's just http://10.xx.xx.11/image.jpg
I may be wrong, but I do have a code that theoretically will work. I just can't test it yet. I uploaded the code to a forked repo at https://github.com/crazyman10123/And...-Driverstation
I didn't upload a new binary, just the code.

Thanks, I'll try this when I get a chance, I no longer have access to our robot.

I do have a question though, does it work to put your code in the start() method of a thread? I have only ever put code in the run() method.

dmaciel10123 23-05-2014 17:04

I probably should change it to the run() method because the way it is right now, start() would never end. I wasn't even paying attention to that haha thanks.

Edit: I fixed the start/run methods, and uploaded the changes to the repo. I'll also be trying it tomorrow at BattleCry when I have access to our bot.

Dr.Gusta 23-05-2014 19:16

Re: Android Driver Station
 
I have a Galaxy S4 and I don't have the option to set my subnet mask and it is asking me for a lot more information. Like Default Gateway, DNS, etc when I try to set up a static IP as instructed.


All times are GMT -5. The time now is 07:18.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi