-
Feb 25th, 2014, 02:12 AM
#1
Making Stupid Android Apps For Education?!!
Man I swear making Android Apps is super hard with Eclipse. So in order to break through the non-userfriendly IDE as well as the learning curve barrier, I'm having to make stupid apps at least 3 to 4 times a day in my spare time. Starting with making a button to where you click, it exits the program. Or turn on a flash light, or open a webpage. Basically I'm doing activities over and over and over again making stupid little programs until its steel trapped. So my first "Shake It" program (my hardest one) seems to be the best app I ever made, even though its still stupid. Every time you shake the phone, it changes the background color of the TextView (or label for VB nuts). But wait theres more! It also vibrates. Sadly.....the vibration part was the easiest thing to code. The shake code seems to be a tiny physics engine after obtaining information from your internal gyrothingamagigger. I dunno, its funny and awesome for 5 minutes, and youre done. Wanna see the code? Ah figures:
java Code:
package com.example.shake;
import android.os.Bundle;
import android.app.Activity;
import android.view.Window;
import android.view.WindowManager;
import android.view.View;
import android.graphics.Color;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.widget.Toast;
import android.os.Vibrator;
import android.widget.Button;
import android.view.View.OnClickListener;
public class MainActivity extends Activity implements SensorEventListener
{
public SensorManager sensorManager;
public boolean color = false;
public View view;
public long lastUpdate = 0;
@Override
protected void onCreate(Bundle savedInstanceState)
{
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
view = findViewById(R.id.lblShakeIt);
view.setBackgroundColor(Color.GREEN);
sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
lastUpdate = System.currentTimeMillis();
Exit_Listener();
}
public void Exit_Listener()
{
Button btnExit = (Button)findViewById(R.id.btnExit);
btnExit.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
finish();
System.exit(0);
}
});
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy)
{
}
@Override
public void onSensorChanged(SensorEvent event)
{
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER)
{
getAccelerometer(event);
}
}
@Override
protected void onResume()
{
super.onResume();
// register this class as a listener for the orientation and
// accelerometer sensors
sensorManager.registerListener(this,
sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
SensorManager.SENSOR_DELAY_NORMAL);
}
@Override
protected void onPause()
{
// unregister listener
super.onPause();
sensorManager.unregisterListener(this);
}
private void getAccelerometer(SensorEvent event)
{
float[] values = event.values;
// Movement
float x = values[0];
float y = values[1];
float z = values[2];
float accelationSquareRoot = (x * x + y * y + z * z)
/ (SensorManager.GRAVITY_EARTH * SensorManager.GRAVITY_EARTH);
long actualTime = System.currentTimeMillis();
if (accelationSquareRoot >= 2) //
{
if (actualTime - lastUpdate < 200)
{
return;
}
lastUpdate = actualTime;
Vibrator v = (Vibrator) getSystemService(VIBRATOR_SERVICE);
// Vibrate for 500 milliseconds
v.vibrate(500);
Toast.makeText(this, "Device was shuffed", Toast.LENGTH_SHORT)
.show();
if (color)
{
view.setBackgroundColor(Color.GREEN);
}
else
{
view.setBackgroundColor(Color.RED);
}
color = !color;
}
}
}
-
Feb 25th, 2014, 04:42 AM
#2
Re: Making Stupid Android Apps For Education?!!
While I have not use Eclipse myself some former classmates on mine would agree! My old college changed to using Eclipse for a few subjects where they had previously use Netbeans.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Feb 25th, 2014, 10:06 AM
#3
Re: Making Stupid Android Apps For Education?!!
Imagine you had an IDE similar to VB (Eclipse). Now, image you simply putting an object in the frame window. Nope, you can't double click it, that would be too user friendly. Yea....you literally have to drag the object into your window.
Ok lets now say its a button. And you wanna change the text. In VB it would be a simple as going to Text in the properties window and change the text of the button. Can you do that in Eclipse? NOOOOOO!!! You have to freaking goto Edit Text, create a new string resource, assign the string and give the resource a name to add it to the list, select it, and click Ok.
Alright now you want to add some code to its click event. In VB you can simply double click it and boom, the click event is created for you and you can put code in right away. In Eclipse though.....that would be too easy. You have to manually code it. Thats right. And not just that, you literally have to import 3 libraries in order to do so:
Code:
import android.widget.Button;
import android.view.View;
import android.view.View.OnClickListener;
Oh but it gets better. You can put the OnClickListener code either in your onCreate sub or you can create a sub and call it in onCreate:
Code:
public void Exit_Listener()
{
Button btnExit = (Button)findViewById(R.id.btnExit);
btnExit.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
finish();
System.exit(0);
}
});
}
Yea you have to remember all of that too since you need to manually type it, along with 100s of other events...
Now you want to simply hit play? HA! Thats too freaking easy! Eclipse wont go that far. You need to create an Android Virtual Device first (an Android Emulator) over in the Android Virtual Device Manager, with the OS, settings, memory, etc. Then once thats done, you need to goto your Java file, goto Run As..., Run Configurations... add the project where project is at, goto the Target tab, and select the Android Virtual Device, and theeeen you can run. Oh it gets better. Once your codes been compiles it needs to take 3 minutes to load the Android device while installing your software. Then finally you can see your program run assuming it works. W T F!!!
And bare in mind its not just Java youre working with, its XML at the same time. So you are working with 2 languages at the same time. Now....DO YOU SEE WHY IM INSANE!!!!
-
Feb 26th, 2014, 04:35 PM
#4
Re: Making Stupid Android Apps For Education?!!
And people wonder why I love MS so much. MS would never release an IDE that's so sub par.
I recently downloaded Xamarin for Android to play around with Android development and I discovered that it integrates with Visual Studio. You build Android apps using C#. I haven't been able to test it thoroughly since I only discovered afterwards that none of the phones anyone has at my house actually runs Android. Anyways, you can get all the benefits that come with Visual Studio but there is a major drawback. It runs terribly slow. It takes ages to compile and execute but even that is preferable to what you just described about Eclipse.
Last edited by Niya; Feb 26th, 2014 at 04:40 PM.
-
Feb 26th, 2014, 05:44 PM
#5
Re: Making Stupid Android Apps For Education?!!
Originally Posted by Jacob Roman
Now....DO YOU SEE WHY IM INSANE!!!!
What was with all that blather that came before the question? We've always known you were insane. Does there really have to be a reason?
My usual boring signature: Nothing
-
Feb 28th, 2014, 05:06 AM
#6
Fanatic Member
Re: Making Stupid Android Apps For Education?!!
And I was thinking about teaching myself java using eclipse.
Hmmmmm
-
Feb 28th, 2014, 07:55 AM
#7
Re: Making Stupid Android Apps For Education?!!
Originally Posted by Jacob Roman
Imagine you had an IDE similar to VB (Eclipse). Now, image you simply putting an object in the frame window. Nope, you can't double click it, that would be too user friendly. Yea....you literally have to drag the object into your window.
Ok lets now say its a button. And you wanna change the text. In VB it would be a simple as going to Text in the properties window and change the text of the button. Can you do that in Eclipse? NOOOOOO!!! You have to freaking goto Edit Text, create a new string resource, assign the string and give the resource a name to add it to the list, select it, and click Ok.
Alright now you want to add some code to its click event. In VB you can simply double click it and boom, the click event is created for you and you can put code in right away. In Eclipse though.....that would be too easy. You have to manually code it. Thats right. And not just that, you literally have to import 3 libraries in order to do so:
Code:
import android.widget.Button;
import android.view.View;
import android.view.View.OnClickListener;
Oh but it gets better. You can put the OnClickListener code either in your onCreate sub or you can create a sub and call it in onCreate:
Code:
public void Exit_Listener()
{
Button btnExit = (Button)findViewById(R.id.btnExit);
btnExit.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
finish();
System.exit(0);
}
});
}
Yea you have to remember all of that too since you need to manually type it, along with 100s of other events...
Now you want to simply hit play? HA! Thats too freaking easy! Eclipse wont go that far. You need to create an Android Virtual Device first (an Android Emulator) over in the Android Virtual Device Manager, with the OS, settings, memory, etc. Then once thats done, you need to goto your Java file, goto Run As..., Run Configurations... add the project where project is at, goto the Target tab, and select the Android Virtual Device, and theeeen you can run. Oh it gets better. Once your codes been compiles it needs to take 3 minutes to load the Android device while installing your software. Then finally you can see your program run assuming it works. W T F!!!
And bare in mind its not just Java youre working with, its XML at the same time. So you are working with 2 languages at the same time. Now....DO YOU SEE WHY IM INSANE!!!!
Wow... how did we ever survive before VisualStudio? Oh yeah, we used NotePad, before that edlin, before that vi... heck BASIC didn't even have an IDE or an editor of any kind initially... please... quit your whining.
If you count XML (which is debatable) as a language, I work with three on a daily basis (XML, VB, SQL), sometimes 5 (add HTML and JS) - and that's just development... I then still also need to speak business, GL, Finance and even gibbereish. And that's before I event come here to the forums.
We're spoiled. We really are.
-tg
Last edited by techgnome; Feb 28th, 2014 at 07:56 AM.
Reason: Quoted the wrong post.
-
Feb 28th, 2014, 04:56 PM
#8
Addicted Member
Re: Making Stupid Android Apps For Education?!!
It's really what you're use to. There was a bit of learning curve when I started using Eclipse, then I got use to it.
-
Feb 28th, 2014, 06:11 PM
#9
Re: Making Stupid Android Apps For Education?!!
And I had to walk to school, uphill, both ways. Actually, it was uphill only in one direction, but it was pretty seriously uphill. I feel that it was a pretty long distance, too, though I realize it was less than two miles.
Times change. The things we are used to are a luxury. That doesn't excuse a bad application, though. The fact is, they could have done better and they didn't.
My usual boring signature: Nothing
-
Feb 28th, 2014, 07:39 PM
#10
Addicted Member
Re: Making Stupid Android Apps For Education?!!
lol I feel you're anti Java Shaggy, It's okay this a vbforum.
-
Feb 28th, 2014, 11:53 PM
#11
Re: Making Stupid Android Apps For Education?!!
Well **** me sideways and call me retarted. Ok, not me, more like ECLIPSE!!!!!
Get this, and put yourself in VB's shoes for a moment. Imagine you created 3 buttons. One to calculate, one to clear, and one to exit. You start with exit first, putting all the properties and code in, run the application, and it exits fine. Then you code the clear button to clear the textbox, and it works ok along with the exit button. But when you do all the properties to the 3rd button calculate, and code it, HOW IN THE HOLY MOTHER OF CHRIST DOES THE CODE IN THE EXIT BUTTON SWAP FROM THE CALCULATE BUTTON?!!!!! No really! If you click calculate, it exits the program, and if you click exit, it calculates. I checked the Id's, they all are fine. I checked the XML. It all checks out. I checked the code. The code is fine. So I deleted the buttons thinking its a glitch and redid the process. AND IT DID THE SAME THING!!!!
I give up on Eclipse. Anyone got a better IDE for Android apps?
-
Mar 1st, 2014, 12:21 PM
#12
Re: Making Stupid Android Apps For Education?!!
Why would you expect another IDE to fix a program bug?
-
Mar 1st, 2014, 02:00 PM
#13
Re: Making Stupid Android Apps For Education?!!
Originally Posted by dilettante
Why would you expect another IDE to fix a program bug?
Where do you see a bug where calculate exits and exit calculates???
java Code:
package com.example.fnlnextractor; import android.os.Bundle; import android.app.Activity; import android.widget.Button; import android.view.View; import android.view.View.OnClickListener; import android.widget.TextView; import android.widget.EditText; import android.widget.Toast; public class FNLNActivity extends Activity { public Button btnExtract; public Button btnClear; public Button btnExit; public TextView lblFirstName; public TextView lblLastName; public EditText txtFullName; public void btnExtract_Click_Event() { btnExtract.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { lblFirstName.setText("Testing"); } }); } public void btnClear_Click_Event() { btnClear.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { lblFirstName.setText(""); lblLastName.setText(""); txtFullName.setText(""); txtFullName.requestFocus(); } }); } public void btnExit_Click_Event() { btnExit.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { finish(); System.exit(0); } }); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_fnln); btnExtract = (Button)findViewById(R.id.btnExtract); btnClear = (Button)findViewById(R.id.btnClear); btnExit = (Button)findViewById(R.id.btnExit); lblFirstName = (TextView)findViewById(R.id.lblFirstName); lblLastName = (TextView)findViewById(R.id.lblLastName); txtFullName = (EditText)findViewById(R.id.txtFullName); btnExtract_Click_Event(); btnClear_Click_Event(); btnExit_Click_Event(); } }
xml Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="top" tools:context=".FNLNActivity" > <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView1" android:layout_below="@+id/textView1" android:layout_marginTop="23dp" android:text="@string/rscFirstName" /> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView2" android:layout_below="@+id/textView2" android:layout_marginTop="24dp" android:text="@string/rscLastName" /> <EditText android:id="@+id/txtFullName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/textView1" android:layout_alignBottom="@+id/textView1" android:layout_toRightOf="@+id/textView2" android:ems="10" android:inputType="textMultiLine" > <requestFocus /> </EditText> <TextView android:id="@+id/lblLastName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/textView3" android:layout_alignBottom="@+id/textView3" android:layout_alignLeft="@+id/lblFirstName" android:text="@string/rscLast" /> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginLeft="31dp" android:layout_marginTop="134dp" android:text="@string/rscFullname" /> <Button android:id="@+id/btnExtract" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/lblLastName" android:layout_marginTop="50dp" android:layout_toLeftOf="@+id/txtFullName" android:text="Button" /> <Button android:id="@+id/btnClear" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/btnExtract" android:layout_alignBottom="@+id/btnExtract" android:layout_alignLeft="@+id/txtFullName" android:text="Button" /> <Button android:id="@+id/btnExit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/btnClear" android:layout_alignBottom="@+id/btnClear" android:layout_toRightOf="@+id/btnClear" android:text="Button" /> <TextView android:id="@+id/lblFirstName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/txtFullName" android:layout_alignTop="@+id/textView2" android:layout_marginLeft="18dp" android:text="@string/rscFirst" /> </RelativeLayout>
-
Mar 2nd, 2014, 12:13 AM
#14
Re: Making Stupid Android Apps For Education?!!
Ok ok so I made slight arrangements and put the button variables within the events as the first line and it worked. You can't just use it in the onCreate all grouped up and expect it to do what you want apparently. Eclipse is ok once you know how to work around the kinks. Either way it should have worked though cause it didn't make sense. But I'm thinking in terms of Visual Basic and not Java....
java Code:
package com.example.fnlnextractor; import android.os.Bundle; import android.app.Activity; import android.widget.Button; import android.view.View; import android.view.View.OnClickListener; import android.widget.TextView; import android.widget.EditText; //import android.widget.Toast; public class FNLNActivity extends Activity { public Button btnExtract; public Button btnClear; public Button btnExit; public TextView lblFirstName; public TextView lblLastName; public EditText txtFullName; public void btnExtract_Click_Event() { btnExtract = (Button)findViewById(R.id.btnExtract); btnExtract.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { lblFirstName.setText("Testing"); } }); } public void btnClear_Click_Event() { btnClear = (Button)findViewById(R.id.btnClear); btnClear.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { lblFirstName.setText(""); lblLastName.setText(""); txtFullName.setText(""); txtFullName.requestFocus(); } }); } public void btnExit_Click_Event() { btnExit = (Button)findViewById(R.id.btnExit); btnExit.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { finish(); System.exit(0); } }); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_fnln); lblFirstName = (TextView)findViewById(R.id.lblFirstName); lblLastName = (TextView)findViewById(R.id.lblLastName); txtFullName = (EditText)findViewById(R.id.txtFullName); btnExtract_Click_Event(); btnClear_Click_Event(); btnExit_Click_Event(); } }
-
Mar 2nd, 2014, 09:09 AM
#15
Fanatic Member
Re: Making Stupid Android Apps For Education?!!
Jacob, if you want a different IDE to Eclipse, give Android Studio a try. I personally think it is far superior as it does a lot of things "out of the box" without much intervention required. It is based on the highly recommended Java IDE IntelliJ IDEA - and there is an open source free version of that so feel free to use that in your Java projects if need be. (Also, you can easily import Eclipse projects, which is a bonus)
Can I just ask though, as someone who has done Java/Android projects (and I am in the middle of an Android project so far), why haven't you just made a method in your FNLNActivity? With Android inside the xml, as long as you have a public void method with a View as a parameter, you can easily make your button onClick link to that method.
Let me give you an example by revising your code:
Java Code:
public class FNLNActivity extends Activity { public Button btnExtract; public Button btnClear; public Button btnExit; public TextView lblFirstName; public TextView lblLastName; public EditText txtFullName; // Here I've "cut the fat", so to speak, and make this method the listener. // Also note that any button can now use this method as it is decoupled, // but you need to set it in the XML file public void extractClick(View view) { lblFirstName.setText("Testing"); } // same with clearClick public void clearClick(View v) { lblFirstName.setText(""); lblLastName.setText(""); txtFullName.setText(""); txtFullName.requestFocus(); } // same with exitClick public void exitClick(View v) { finish(); System.exit(0); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_fnln); lblFirstName = (TextView)findViewById(R.id.lblFirstName); lblLastName = (TextView)findViewById(R.id.lblLastName); txtFullName = (EditText)findViewById(R.id.txtFullName); } }
And then in your activity's xml layout:
xml Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="top" tools:context=".FNLNActivity" > <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView1" android:layout_below="@+id/textView1" android:layout_marginTop="23dp" android:text="@string/rscFirstName" /> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView2" android:layout_below="@+id/textView2" android:layout_marginTop="24dp" android:text="@string/rscLastName" /> <EditText android:id="@+id/txtFullName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/textView1" android:layout_alignBottom="@+id/textView1" android:layout_toRightOf="@+id/textView2" android:ems="10" android:inputType="textMultiLine" > <requestFocus /> </EditText> <TextView android:id="@+id/lblLastName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/textView3" android:layout_alignBottom="@+id/textView3" android:layout_alignLeft="@+id/lblFirstName" android:text="@string/rscLast" /> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginLeft="31dp" android:layout_marginTop="134dp" android:text="@string/rscFullname" /> <Button android:id="@+id/btnExtract" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/lblLastName" android:layout_marginTop="50dp" android:layout_toLeftOf="@+id/txtFullName" android:onClick="extractClick" android:text="Button" /> <Button android:id="@+id/btnClear" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/btnExtract" android:layout_alignBottom="@+id/btnExtract" android:layout_alignLeft="@+id/txtFullName" android:onClick="clearClick" android:text="Button" /> <Button android:id="@+id/btnExit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/btnClear" android:layout_alignBottom="@+id/btnClear" android:layout_toRightOf="@+id/btnClear" android:onClick="exitClick" android:text="Button" /> <TextView android:id="@+id/lblFirstName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/txtFullName" android:layout_alignTop="@+id/textView2" android:layout_marginLeft="18dp" android:text="@string/rscFirst" /> </RelativeLayout>
Notice the androidnClick syntax in the XML code. I could understand if you were creating an onClickListener if you were using Android Fragments since due to the nature of Fragments you will absolutely need to set an onClickListener, but you can save yourself a ton of hassle if you just write your code like that.
I will admit, mixing XML and Java may feel crazy at first, but if you use Android Studio like I do, the IDE does a fantastic job of integrating your XML activity code with the Java code and so-forth such that it really doesn't feel all that insane. I'm not a big fan of the XML language, but the idea of decoupling the layout of the screen from the Activity/Fragment was, I feel, a great idea which has the added bonus of doing cool things like refactoring button styles/themes and so on.
And I suggest you don't fret over imports. One of Java's biggests strengths is the amount of third party packages written for Java to do practically anything. I honestly wouldn't fret over the number of import statements you have, and Android Studio does a good job of cleaning imports.
-
Mar 2nd, 2014, 10:09 AM
#16
Re: Making Stupid Android Apps For Education?!!
Thanks for the tips. I kinda like the other way for some reason o.O.
I might give that IDE a try, as well as netbeans. Maybe I might something I'll like.
-
Mar 2nd, 2014, 10:36 PM
#17
Re: Making Stupid Android Apps For Education?!!
I don't know if you've looked at Basic4android or not, but I've been thinking about checking it out when I get some time.
The main drawbacks seems that you won't get to practice XML at all since it isn't necessary, and having to deal with Java sounds like it would be a rare occurrence, although you can wrap java code and use it if necessary.
Another problem is your typical VB programmer can make a more progress in a few hours than they've been able to do after weeks of working in other development environments, I've read, so there is a large pool of potential programmers that can easily jump in.
Since it generates fully certifiable applications that can be sold in the apps store, quite a few other companies and independent developers are starting to use it so there will be likely more competition growing quickly soon.
Of course you do have to pay for it, so that may keep some away, and it is a similar to Visual Basic, and we know real programmers don't use VB, so who wants that stigma.
-
Mar 3rd, 2014, 12:08 AM
#18
Re: Making Stupid Android Apps For Education?!!
Actually I prefer to use Java since thats the language for android apps anyways. Plus I need to learn how to use OpenGL or something similar so I can start taking my game programming skills to tablets and smartphones
The idea is to make an original game with advertisements so I can start getting ad revenue, and make another version of the game that someone would have to purchase in the Google Play store without ads. Its a way I can start making money doing what I love without depending on a job. Call it entrepreneurship. Its the American way lol. It cost only $25 for you to be able to submit apps in the Google Play store. However in the iOS area, it costs $500 for you to be able to submit apps in the iTunes store. Sadly I don't have $500 nor know Objective-C
Last edited by Jacob Roman; Mar 3rd, 2014 at 12:12 AM.
-
Mar 5th, 2014, 07:17 AM
#19
Re: Making Stupid Android Apps For Education?!!
I Believe it is 100 bucks per year for iTunes. The objective-C IDE is quite nice, but overwhelming, at first. You also need a Mac...so there's your $500...
[as a side note, I'd call objective-C 'obnoxious-C'...as long as you know the absolute fundamentals of programming, and stop comparing objective-C to .NET, and looking for equivalencies where there are none, it's not too bad].
"Ok, my response to that is pending a Google search" - Bucky Katt.
"There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
"Before you can 'think outside the box' you need to understand where the box is."
-
Mar 6th, 2014, 10:51 AM
#20
Re: Making Stupid Android Apps For Education?!!
Alright!!! My first 2D texture mapping example using Android Eclipse Java and OpenGL
AND IT FREAKING WORKS!!! Now I can use my DX skills and port it to android....only its OpenGL. Gonna be making games right away.
MainActivity.java
java Code:
package com.example.texturemap; import android.os.Bundle; import android.app.Activity; //Used to make the app fullscreen import android.view.Window; import android.view.WindowManager; //Used for OpenGL graphics initialization import android.opengl.GLSurfaceView; public class MainActivity extends Activity { private GLSurfaceView glSurfaceView; private void Set_FullScreen() { requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } private void Initialize_OpenGL() { glSurfaceView = new GLSurfaceView(this); glSurfaceView.setRenderer(new OpenGL_Renderer(this)); setContentView(glSurfaceView); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Set_FullScreen(); Initialize_OpenGL(); } @Override protected void onResume() { super.onResume(); glSurfaceView.onResume(); } @Override protected void onPause() { super.onPause(); glSurfaceView.onPause(); } }
OpenGL_Renderer.java
java Code:
package com.example.texturemap; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import android.content.Context; import android.opengl.GLU; import android.opengl.GLSurfaceView.Renderer; public class OpenGL_Renderer implements Renderer { private Polygon polygon; private final Context context; public OpenGL_Renderer(final Context context) { this.context = context; polygon = new Polygon(); } @Override public void onDrawFrame(GL10 gl) { gl.glClear(GL10.GL_COLOR_BUFFER_BIT); gl.glLoadIdentity(); gl.glTranslatef(0.0f, 0.0f, 0.0f); polygon.draw(gl); } @Override public void onSurfaceChanged(GL10 gl, int width, int height) { if(height == 0) height = 1; gl.glDisable( GL10.GL_CULL_FACE ); gl.glDisable( GL10.GL_DEPTH_TEST ); gl.glLoadIdentity(); gl.glViewport(0, 0, width, height); gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); //GLU.gluPerspective(gl, 45.0f, (float)width / (float)height, 0.1f, 100.0f); GLU.gluOrtho2D(gl, (float)0, (float)width, (float)height, (float)0); gl.glMatrixMode(GL10.GL_MODELVIEW); gl.glLoadIdentity(); } @Override public void onSurfaceCreated(GL10 gl, EGLConfig config) { polygon.loadTexture(gl,this.context,R.drawable.jake); gl.glEnable(GL10.GL_TEXTURE_2D); gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f); } }
Polygon.java
java Code:
package com.example.texturemap; //import java.io.IOException; //import java.io.InputStream; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import javax.microedition.khronos.opengles.GL10; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.BitmapFactory.Options; import android.opengl.GLUtils; public class Polygon { private FloatBuffer vertexBuffer; // buffer holding the vertices private FloatBuffer textureBuffer; public int[] textures = new int[1]; public float texture[] = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f }; public float vertices[] = { 0.0f, 0.0f, 0.0f, // V1 - first vertex (x,y,z) 200.0f, 0.0f, 0.0f, // V2 - second vertex 0.0f, 200.0f, 0.0f, // V3 - third vertex 200.0f, 200.0f, 0.0f // V4 - forth vertex }; public Polygon() { // a float has 4 bytes so we allocate for each coordinate 4 bytes ByteBuffer byteBuffer = ByteBuffer.allocateDirect(vertices.length * 4); byteBuffer.order(ByteOrder.nativeOrder()); // allocates the memory from the byte buffer vertexBuffer = byteBuffer.asFloatBuffer(); // fill the vertexBuffer with the vertices vertexBuffer.put(vertices); // set the cursor position to the beginning of the buffer vertexBuffer.position(0); byteBuffer = ByteBuffer.allocateDirect(texture.length * 4); byteBuffer.order(ByteOrder.nativeOrder()); textureBuffer = byteBuffer.asFloatBuffer(); textureBuffer.put(texture); textureBuffer.position(0); } public void loadTexture(GL10 gl, final Context context, final int resourceId) { final Options options = new Options(); options.inScaled = false; // loading texture final Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), resourceId, options); //InputStream is = context.getResources().openRawResource(R.drawable.jake); //Bitmap bitmap = null; //try { // bitmap = BitmapFactory.decodeStream(is); //} finally { // //Always clear and close // try { // is.close(); // is = null; // } catch (IOException e) { // } //} // generate one texture pointer gl.glGenTextures(1, textures, 0); // ...and bind it to our array gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]); // create nearest filtered texture gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR); // Use Android GLUtils to specify a two-dimensional texture image from our bitmap GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); // Clean up bitmap.recycle(); } public void draw(GL10 gl) { gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]); gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY); // set the color for the triangle R G B A //gl.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); // Point to our vertex buffer gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer); gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer); // Draw the vertices as triangle strip gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4); //Disable the client state before leaving gl.glDisableClientState (GL10.GL_VERTEX_ARRAY); gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY); } }
-
Mar 6th, 2014, 05:01 PM
#21
Re: Making Stupid Android Apps For Education?!!
Are you still using Eclipse?
I just hired a coder - and he's done Android stuff in school.
He's going to make me an Android app that will talk to web methods that I've got running (against web pages now) - hopefully being able to send HTTP POST's and deal with the JSON that gets returned.
I was going to let my regular web app be used for this - now starting to think a real app on the device will be a cleaner and tighter experience for the user.
-
Apr 23rd, 2014, 01:28 PM
#22
Re: Making Stupid Android Apps For Education?!!
Have you tried working with Android Studio? You still need to create an AVD (Android Virtual Device) though.
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|