View Single Post
  #58  
Old November 10th 18, 09:57 AM posted to comp.mobile.android,alt.comp.freeware,microsoft.public.windowsxp.general
Arlen_Holder
external usenet poster
 
Posts: 96
Default Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)

On Sat, 10 Nov 2018 07:04:22 -0000 (UTC), Diesel wrote:

You keep changing your position on that, Arlen.


Hi Diesel,
Thanks for all your kind and helpful advice.

I'm learning stuff by doing, where, for example, I learned just now that
if I run the Microsoft Android Emulator directly, then it "remembers" the
previously installed apps as shown here (as opposed to flushing them every
time, which happens when I run the Microsoft Emulation Manager instead):
http://www.bild.me/bild.php?file=4126667androidstudio53.jpg

You chose to purchase a piece of **** without knowing what was under
the hood.


Actually, I got the desktop for free as a broken handmedown.
It was easy to fix (it needed new hard drives, cables, WiFi card & a fan).

Actually, you're wrong (again). It's not a difficult thing to do for
anyone who has programming experience under their belt, and, I'm not
talking about his/her first virgin breaking hello world job, either.


Thanks for that advice, where, based on your always on-target help,
I found the "Build" menu which rebuilt the "build" directory that
contained the generated code that had stale paths to the app03
directory structure.
http://www.bild.me/bild.php?file=5602322androidstudio51.jpg

For crying out loud, you're working with a script based language. You
aren't doing any serious 'coding' on your own here.


Nobody said there was _any_ coding being done yet.

What Bill and I are doing is "driving the car" with the passenger being
an experienced driver as the PIC (namely the passenger is the tutorial).

The coding that we will need your help and advice on happens after we
get done with our test drives, will be the following simple stuff:
1. You press an icon named "10"
2. It beeps to let you know it started
3. Ten minutes later, an alarm rings

People like you did, but, people like you, thankfully, are not
everyone.


I agree with you that I'm 1 out of 1,000 in that my goal always,
is to help people, where I do it for free all the time,
and I collaborate when I can.

That's who I am.
Most people are the opposite of me.

That's why all my apps will be free, with no ads, & no shenanigans.

As it is right now though, you aren't doing anything complicated to
anyone with a programming background. You're a n00bie taking baby
steps.


As I said, I'm a noob. I'm not afraid to admit that I'm a noob.

If this thread gives other noobs a good starting point, then that's good.
If the resulting code benefits them, as it did for Bill, then that's good.
If we can get a simple 10-minute timer app out of this, then that's good.

To that end, here's the next Android app ... app05
http://www.bild.me/bild.php?file=8495103androidstudio57.jpg
where
app01 = hello world
app02 = calls an activity within the app
app03 = adder
app04 = copy of that adder
app05 = calls activity inside and outside the app

If Bill, or anyone else needs the java code, here it is:
================================================== ==========================
C:\tmp\android\app05\app\src\main\java\com\kiss\ap p05\MainActivity.java
================================================== ==========================
package com.kiss.app05;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

// Attempts to launch an activity within our own app
Button secondActivityBtn = (Button) findViewById(R.id.secondActivityBtn);
secondActivityBtn.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
Intent startIntent = new Intent(getApplicationContext(), SecondActivity.class);
// show how to pass inforation to another activity
startIntent.putExtra("com.kiss.app05.SOMETHING", "HELLO WORLD!");
startActivity(startIntent);
}
});

// Attempt to launch an activity outside our app
Button googleBtn = (Button) findViewById(R.id.googleBtn);
googleBtn.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
String google = "http://www.google.com";
Uri webaddress = Uri.parse(google);

Intent gotoGoogle = new Intent(Intent.ACTION_VIEW, webaddress);
if (gotoGoogle.resolveActivity(getPackageManager()) != null) {
startActivity(gotoGoogle);
}
}
});
}
}
================================================== ==========================
C:\tmp\android\app05\app\src\main\java\com\kiss\ap p05\SecondActivity.java
================================================== ==========================
package com.kiss.app05;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

public class SecondActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);

if (getIntent().hasExtra("com.kiss.app05.SOMETHING")) {
TextView tv = (TextView) findViewById(R.id.textView);
String text = getIntent().getExtras().getString("com.kiss.app05. SOMETHING");
tv.setText(text);
}
}
}
================================================== ==========================
http://www.bild.me/bild.php?file=8495103androidstudio57.jpg
Ads