Discussion Forums  >  Introduce Yourself

Replies: 4    Views: 64

mattTheBro
Android Fan
Profile
Posts: 4
Reg: Dec 04, 2012
Fayetteville, N...
6,340
03/20/13 03:04 PM (12 years ago)

I'm still learning...

I was introduced to this site in my C/C++ class. Since then, I have begun making my first app, a sound-bite maker. This, and every app I will make, will be exclusively for Android. The inspiration behind this app is as follows: I have often heard little tidbits (some useful, some just silly stuffandfluff) that I thought, "If only I could put those on my phone so I could play them whenever." So far, I have hit a snag. I have not figured out how to make a button do an action instead of pulling up a different screen. Is there some sort of Plugin that I am missing, or do I need to change that Eclipse, or what?
 
allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
like
03/20/13 03:21 PM (12 years ago)
You probably have to create the plug in yourself. There is a guy that is real good at that kind of stuff on youtube. Search "thenewboston" He has a lot of tutorials on that kind of stuff.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/20/13 04:57 PM (12 years ago)
In it's simplest form: (your layout.xml file...) <?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/containerView" android:background="@android:color/transparent" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:id="@+id/btnDoSomething" android:layout_width="match_parent" android:layout_height="60dip" android:layout_marginTop="5dip" android:text="I am a button and I want to do something!" /> </RelativeLayout> (your code.java file....) package com.buzzTouch; public class doDaButton extends BT_activity_base{ public void onCreate(Bundle savedInstanceState){ /// Put this in your onCreate method /// listenToDaButtons(); //////////////////////////////////////// } protected void onStart() {} public void onResume() {} public void onPause() {} protected void onStop(){} public void onDestroy() {} public void doSomethingCool() { // something cool is done here... } public void listenToDaButtons(){ btnDoSomething = (Button) findViewById(R.id.btnDoSomething); btnDoSomething.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // do something here doSomethingCool(); } }); } } ----------------------------------- 1) the layout is your canvas. It's your screen. 2) the java file is your engine. it does what you want. 3) you tell the java file to 'listen' for any click on a button that YOU SPECIFY 4) you write the code to do something when someone clicks on the button It sounds simple, and it is. But sometimes it takes a little bit to get your head around it. when the light comes on, you'll be just fine. Cheers! -- Smug (oh, and welcome to Buzztouch!!)
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
03/20/13 07:34 PM (12 years ago)
Hi Matt, Welcome to buzztouch! Sounds like an interesting app! Smug is the man...follow him, and you'll learn a ton! I'm assuming you realize that Android apps are programmed in Java, not C/C++? Though those are certainly good languages to learn for fundamental understanding of coding. Any reason you're excluding iOS apps? The awesome thing about buzztouch is that you can create something in your control panel, and then download the source for both. Two apps for the price of one! Looking forward to seeing what you come up with! Mark
 
mattTheBro
Android Fan
Profile
Posts: 4
Reg: Dec 04, 2012
Fayetteville, N...
6,340
like
03/21/13 06:08 AM (12 years ago)
Thanks, everyone. I do realize that Android is Java. The C/C++ class was last semester. This semester I'm learning C# and Java. The reason I'm excluding iOS is simple: I have no computers compatible with xCode, and even if I did, I don't have the money for that Apple license.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.