Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

test: Reply
 
LinkBack Thread Tools
Old December 10th, 2012, 08:28 PM   #1 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Dec 2012
Posts: 16
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default Supa newb!

HI guys,

just about me, i am an ET and have been picking up software development as i go, i am familiar enough in c & vb, that i can do codes to suit my needs,323,uart,i2c,spi,etc... and have recently installed eclipse for my android clone phone, I was also able to get the hello world program going, aswell as a simple counter. I got eclipse and the android since i feel that with the tilt sensors and other features makes it a universal device, come to think of it all its missing is irda comm and video input!

anyway i am here since the first app i want to do is a ip camera interface, but what is special about mine is i will need to add a overlay of buttons that will send specific http instructions.

The buttons i feel will be simple(er), and i will need only little coaching for it, however it is the interface that i really need help with.

I have no idea where to begin, how to use the classes, or have ever done anything with lan connections, i even got java for dummies, but doesnt really describe the instructions im seeing in even the basic youtube tutorials, preferably i'd like a sample code thrown at me or even a place where lots of examples exist, but if i really need to do my own any pointers could help.

(If sdk developers are reading i really like objects and wish all the controls were objected like vb6, object icon for bluetooth, object icon for gyro...ect...)

Advertisements
DR doggy is offline  
Reply With Quote
sponsored links
Old December 11th, 2012, 09:51 AM   #2 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

Assuming you know how to use the Camera in Android, you just need to wrap the camera's SurfaceView in a RelativeLayout in your layout file, then inside the RelativeLayout, also add whatever other UI controls you want and position them relative to the SurfaceView however you feel necessary.
__________________
My blog, Inverted Keystrokes, is looking for aspiring developers (not necessarily with Android) to post articles. If you have any development experience and are interested in participating, please PM me. =)
jonbonazza is offline  
Reply With Quote
Old December 11th, 2012, 10:10 AM   #3 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Dec 2012
Posts: 16
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

nope do not! but i will presume that i need to use the camera surfaceview function based on what you say. i also dont know what a relative layout is, but google is my friend, brb when i get this basic setup started
DR doggy is offline  
Reply With Quote
Old December 13th, 2012, 07:02 AM   #4 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Dec 2012
Posts: 16
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

hey, also i just want to make sure i understand what you are saying there before i hit the books,,

so now when you say camera you are talking about a window for the camera that takes photographs?

and when you say relative layout you are talking about the main form?

sry, but your avatar describes how i feel about learning this new language, i am finding it way more complex to even set up, compared to my low level bit banging..

im also wondering if it may be easier to hire someone and where to find that someone, to just spend half a day for 100$, for them to get my source code together, i forsee a small project here for someone who knows, this is for a personal device so redistribution is not likely either
DR doggy is offline  
Reply With Quote
Old December 13th, 2012, 09:17 AM   #5 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

I think you should stick at it so you have the knowledge you need in the future rather than hire someone. =)

As for clarification, when I say "camera," I am referring to the camera preview, where you can move the phone around and the window will show you what the camera device is seeing. RelativeLayout is a Layout that encapsulates UI controls. You define this along with your UI controls in a layout xml file.

For example, say you subclassed SurfaceView and called it CameraView, your layout xml file would looks something like this:

camera_activity.xml:
Code:
<<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/camera_layout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
>
    <CameraView
        android:id="@+id/camera_view"
        android:layout_width="fill_parent"
        android:layout_height="fille_parent"
    />
    <Button
        android:id="@+id/overlay_button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
    />
    <!--More UI Controls here, aligned relative to parent and/or other UI controls -->
</RelativeLayout>
This would make the camera preview take up the full screen, but there would be a button on top of it, placed in the middle of the screen.
jonbonazza is offline  
Reply With Quote
Old December 22nd, 2012, 01:13 AM   #6 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Dec 2012
Posts: 16
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

ok, i copied that code, however it did not like this line:
<<?xml version="1.0" encoding="utf-8"?>
so i deleted it;

even though it is compiling and loading to my device there is a little box just under my graphical layout saying that cameraview class cannot be found, at the same time i am wondering, may have forgot to mention i want to stream in the IPcamera video, am i using the right class?
what about

palette\Images & media \ imageview
or
palette\images & media \ videoview
or maybe surface view,? wHAT is that??


so next, i guess, is the hard part, i need to open a internet port, then connect the camera data to the imageview?



.......also i just found out you may want to know that the IPcamera im trying to connect to uses MJPEG, and http instructions..


AND!! reviewing this thread i just want to clear up that i am trying to do an app similar to this:
https://play.google.com/store/apps/details?id=com.vididev.foscam.ipcam&feature=relate d_apps#?t=W251bGwsMSwxLDEwOSwiY29tLnZpZGlkZXYuZm9z Y2FtLmlwY2FtIl0.
DR doggy is offline  
Last edited by DR doggy; December 22nd, 2012 at 02:11 AM.
Reply With Quote
Old December 22nd, 2012, 01:30 PM   #7 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

As I mentioned in my previous post, CameraView is a custom class that is a subclass of SurfaceView and implements the SurfaceHolder.Callback interface.

See here:
CameraTutorial - openmobster - Android Camera Integration - OpenMobster - Open Source Mobile Enterprise Backend - Google Project Hosting
jonbonazza is offline  
Reply With Quote
Old December 22nd, 2012, 01:57 PM   #8 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Dec 2012
Posts: 16
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

GOT IT!!!

an only 3 days!! and i appreciate eclipse much more now the way it does everything for you, but i remain with 3 more questions:

can i turn a slider vertical?
and how do i read a cursor position(ie where my finger is when i hold a button down?)
DR doggy is offline  
Last edited by DR doggy; December 24th, 2012 at 01:53 AM.
Reply With Quote
Old December 24th, 2012, 10:23 PM   #9 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

What do you mean make a slider vertical? what slider are you referring to?

As for touch location, you can implement an OnTouchListener, assign it to a particular View (or Views) and one of the arguments passed into OnTouchListener.onTouch() is a MotionEvent object. You can get the exact pixel location of the touch by using the getX() and getY() methods of this object.
jonbonazza is offline  
Reply With Quote
Old December 25th, 2012, 10:05 PM   #10 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Dec 2012
Posts: 16
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

k, ontouch snds easy enough,

as for slider i mean "seekbar", in vb i used "hscroll"&"Vscroll" bars alot to input my variables.

lol, right now i am using rating bars and radiogroups! maybe there is better?

also is there a way to set my webview, so that it will scroll to , say, half way down the page, zoom a bit, and maybe even hold it there? i may be interested to set it so that user can see the webpage, but not be able to click on(in) it, possible?

For now though i have hit a brick wall, please look at my screenshot and tell me why splash err shows up? i did something, but ctrl-z did not fix, when it started R was underlined, so i did quick fix import of r, but now splash? also similar happening with all other findviewbyid's.
Attached Images
File Type: jpg androidstuff.jpg (123.4 KB, 2 views)
DR doggy is offline  
Reply With Quote
sponsored links
Old December 26th, 2012, 08:34 AM   #11 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

Oh. I don't believe that a SeekBar can be turned vertical since it is a subclass of ProgressBar.

As for your error with R.layout.splash, first, make sure the R.java file exists in the gen folder in your project. If it does, it *should* pick it up, but you can always force it by explicitly importing <base-package-name>.R

If it's not there, then you have an error somewhere in one of your resources.
jonbonazza is offline  
Reply With Quote
Old December 27th, 2012, 04:01 AM   #12 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Dec 2012
Posts: 16
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

what is good to use as a scroll bar then? i am thinking of similar to a volume switch.

also it was in the R file, it turns out i deleted it, then somehow got one without the ids, problem solved now thou,

but again:
is there a way to set my webview, so that it will scroll to , say, half way down the web page, zoom a bit, and maybe even hold it there? i may be interested to set it so that user can see the webpage, but not be able to click on(in) it, is that possible?
DR doggy is offline  
Reply With Quote
Old December 27th, 2012, 09:22 AM   #13 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

Sure. WebView has a few methods you might be interested in:

- setVerticalScrollBarEnabled
- setHorizontalScrollBarEnabled
- scrollTo
- getScrollX
- getScrollY
- getSettings().setDefaultZoom
jonbonazza is offline  
Reply With Quote
The Following User Says Thank You to jonbonazza For This Useful Post:
DR doggy (January 2nd, 2013)
Old December 27th, 2012, 06:17 PM   #14 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Dec 2012
Posts: 16
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

OKAY!


edit:

i think i have url problem, this works:
http://trackfield.webcam.oregonstate.edu/axis-cgi/mjpg/video.cgi?resolution=800x600&amp%3bdummy=133368999 8337

but this doesnt:

http://doggycamIP:99/snapshot.cgi
or
http://doggycamIP:99/videostream.cgi
or this:
http://doggycamIP:99/videostream.cgi?resolution=800x600&amp%3bdummy=133 3689998337

i even use authentication\:
http://l@doggycamIP:99/videostream.cgi

it keeps returning 401 no matter what, an cannot disable cam security
DR doggy is offline  
Last edited by DR doggy; December 29th, 2012 at 08:50 PM.
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 04:07 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.