• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Supa newb!

DR doggy

Newbie
Dec 10, 2012
16
0
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...)
 
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.
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
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/...wxLDEwOSwiY29tLnZpZGlkZXYuZm9zY2FtLmlwY2FtIl0.
 
Upvote 0
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.
 
Upvote 0
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.
 

Attachments

  • androidstuff.jpg
    androidstuff.jpg
    123.4 KB · Views: 32
Upvote 0
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.
 
Upvote 0
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?
 
Upvote 0
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones