Supa newb!

Last Updated:

  1. DR doggy

    DR doggy Member

    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...)

  2. jonbonazza

    jonbonazza Well-Known Member

    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.
  3. DR doggy

    DR doggy Member

    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
  4. DR doggy

    DR doggy Member

    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
  5. jonbonazza

    jonbonazza Well-Known Member

    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:

    Code (Text):
    2. <<?xml version="1.0" encoding="utf-8"?>
    3. <RelativeLayout
    4.     xmlns:android=""
    5.     android:id="@+id/camera_layout"
    6.     android:layout_width="fill_parent"
    7.     android:layout_height="fill_parent"
    8. >
    9.     <CameraView
    10.         android:id="@+id/camera_view"
    11.         android:layout_width="fill_parent"
    12.         android:layout_height="fille_parent"
    13.     />
    14.     <Button
    15.         android:id="@+id/overlay_button1"
    16.         android:layout_width="wrap_content"
    17.         android:layout_height="wrap_content"
    18.         android:layout_centerInParent="true"
    19.     />
    20.     <!--More UI Controls here, aligned relative to parent and/or other UI controls -->
    21. </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.
  6. DR doggy

    DR doggy Member

    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
    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:
  7. jonbonazza

    jonbonazza Well-Known Member

  8. DR doggy

    DR doggy Member

    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?)
  9. jonbonazza

    jonbonazza Well-Known Member

    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.
  10. DR doggy

    DR doggy Member

    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 Files:

  11. jonbonazza

    jonbonazza Well-Known Member

    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 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.
  12. DR doggy

    DR doggy Member

    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?
  13. jonbonazza

    jonbonazza Well-Known Member

    DR doggy likes this.
  14. DR doggy

    DR doggy Member

Share This Page