A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)



 
 
Thread Tools Display Modes
  #46  
Old November 6th 18, 05:58 PM posted to comp.mobile.android,alt.comp.freeware,microsoft.public.windowsxp.general
Bill[_40_]
external usenet poster
 
Posts: 346
Default Report: My first "hello world" using Android Studio freeware onWindows worked just fine (in about an hour)

On 06/11/2018 03:20, Arlen_Holder wrote:
On Sun, 4 Nov 2018 08:46:01 -0000 (UTC), Diesel wrote:

Open regedit, navigate to
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools


Hi Diesel,

Thanks for your help and advice as I admit I'm an Android noob.

I just snapped this snapshot for you so you can see what I have:
http://www.bild.me/bild.php?file=3834577androidstudio32.jpg

Maybe Bill can tell us what his registry key looks like, since he has the
same tools installed.


That registry key does not exist on either of the Intel machines here. A
search finds nothing obviously relating to the Android sdk.

I have the 2 machines the newer tablet laptop X220T on W7 and with
Android Studio using defaults
and the older X201 straight laptop running W10, with non-default
directories.

On both, the "Appearance and Behaviour" SDK Tools listing is identical
to yours, wxcept that the HAXM is ticked.

The X201 seems to be working well and the emulator is fine. There is a
warning about the display drivers, but I have a good display.

The X220T came to me with a WWAN module installed and, presumably
working. To fit the mSATA boot SSD, this had to be removed to free the
slot.
As soon as I started trying to get the emulator to work, there were
error messages relating to the WWAN. I assume the emulator was trying to
connect to the phone components of the laptop. I have now removed all
the WWAN related software on the machine, but the emulator still doesn't
fully appear. I get the surround, but with a transparent screen.

There hasn't been time to do much more. I'm still on the text based app.

--
Bill

---
This email has been checked for viruses by AVG.
https://www.avg.com

Ads
  #47  
Old November 6th 18, 08:06 PM 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 Tue, 6 Nov 2018 15:33:23 -0000 (UTC), Diesel wrote:

I couldn't help but notice you now specifically use the words,
'visible' file system; instead of full access as you previously (yet
incorrectly) assumed that 3rd party driver you thought only you knew
about (hahaha) gave you.


Hi Diesel,
I think I may have not been clear, so I apologize that you seem to have
misunderstood what "visible" means, where I've used the term
umpteen times on Windows, Linux, Android, and iOS contexts, so I simply
assumed you understood what it means in the context of the typical user.

It's all about read/write permission.

What visible indicates is what a typical "user" can read/write to.
o On Linux home desktops, that's typically everything
o On Windows home desktops, it's typically everything

However, if you're at the local public library, then the "visible" file
system (aka, the area the user can read and write to), may be vastly
limited.

Given the context of a desktop writing to a mobile device, I don't expect
the desktop to write to the "non visible" portion of the mobile device
(without rooting/jailbreaking).

Does that clarification make sense to you yet?

It's my fault that you seemed to miscomprehend what "visible file system"
means, where you seem to have attributed, seemingly, some sort of sinister
intent, but it just means what the user can read and write to.
o On Android, it's typically _not_ the entire file system
o On iOS, it's even far less of the file system

To the point of the "visible" file system on Android, there's no problem
for a typical user to read _and write_ to that _entire_ visible file system
from the desktop (e.g., from Windows).

But the trick, always, in cross platform read/write compatibility, is not
Android and Windows, but iOS and Windows (or iOS and Linux).

Put another way, it's easy to claim cross platform compatibility if you
ignore either iOS, or if you ignore the entire visible file system on iOS.

A simple test of the ability to _write_ to the entire visible file system
of iOS is to simply write to the DCIM directy from the desktop over USB.
o I can easily do that
o But almost nobody else can

Why not?
They don't know what I know about writing to the iOS visible file system.

To wit:
o I can read _and write_ to the entire visible iOS file system
o But most people can't do that.

How can I prove that most people can't do that?
o Just slide a file from their desktop onto the iOS DCIM directory.

IMHO, 999 out of 1,000 people will fail at that simple task.
And yet, DCIM is clearly a component of the iOS visible file system.

I hear a _lot_ of people _claim_ they can do it, but if they can't tell me
how they did it, then I _know_ they're just making up those claims (hoping
that nobody realizes that they don't actually know how to do it).

You're not one of those people Diesel, who would make a claim without being
able to actually do it - but a lot of people _think_ they're far smarter
than they really are ...

And the proof (in this case) is simple:
o If they can write from the desktop to the DCIM directory
Then what they claim is true
o If they can _not_ write from the desktop to the DCIM directory
Then what they claim is false.

As I said, it's binary (where the DCIM directory is just _one_ of the many
directories in the typical iOS visible file system).
  #48  
Old November 6th 18, 10:43 PM 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 Tue, 6 Nov 2018 16:58:26 +0000, Bill wrote:

That registry key does not exist on either of the Intel machines here. A
search finds nothing obviously relating to the Android sdk.


Thank you very much, Bill, for that independent confirmation!
As as admitted Android noob, _all_ this is _new_ to me.
So your confirmation of even simple things - helps a LOT!

THANKS!!!!!!!

In 20/20 hindsight, I think this registry edit was a red herring.
I've since _deleted_ it, and everything _still_ works perfectly!
http://www.bild.me/bild.php?file=7301488androidstudio29.jpg

I have the 2 machines the newer tablet laptop X220T on W7 and with
Android Studio using defaults and the older X201 straight laptop
running W10, with non-default directories.


Thanks for that information as our experience can help each other if we
trust what we say (where you can always trust what I say as fact).

Like you, I prefer to put things where I can find them, where I've already
explained in gory detail where I put stuff.

Early this morning, I wiped everything out & started fresh where I decided
to let Android Studio do all the downloading of everything but the
Microsoft Emulator (which you don't need since you're on Intel CPUs).

Here are the main three installation steps.
1. Install the Android Studio IDE (which adds the JDK & Google Emulators)
C:\app\editor\android\ide\android_studio
2. Optionally (if you're on older AMD), install the MS Emulation Manager
C:\Program Files (x86)\Microsoft Emulator Manager
3. Configure that MS Emulation Manager to run inside the Android Studio IDE

Then, to run the apk on either a physical phone or on an emulated phone:
A Start the Android Studio IDE
B Start the MS Emulation Manager
(AndroidStudio:Tools External Tools MS Emulation Manager)
C Pick any desired Android device under test & Android API
(e.g., Galaxy S5 on Android 7.0 using x86)
D Send your app from the Android Studio IDE to your device under test
(AndroidStudio: Run Run 'app')
Voila!
http://www.bild.me/bild.php?file=9175315app02b.gif


On both, the "Appearance and Behaviour" SDK Tools listing is identical
to yours, wxcept that the HAXM is ticked.


Thank you Bill for kindly confirming those checkbox settings inside the
Android Studio IDE.

It helps GREATLY that you confirmed the settings are the same, with the
expected exception of the HAXM checkbox because I'm on AMD while you're on
Intel.

Since you have HAXM, you can use the Google-supplied emulators; but I have
to use the Microsoft x86 emulator - which - in the end - is the same thing
since we're noobs at this stage - so _any_ emulator that works is a good
emulator.

One "choice" I don't understand yet is why we even have the choice of "arm"
or "x86", when we choose an emulator, since both work, but the arm choice
is clearly more than ten times slower than the x86, and since the X86 is
the default.
arm slow http://www.bild.me/bild.php?file=2999468androidstudio24.jpg

The X201 seems to be working well and the emulator is fine. There is a
warning about the display drivers, but I have a good display.


I too get a bunch of warnings, but everything is working so I'm not even
looking at those warnings.

I'm curious, Bill ... does your emulation work about the same speed as your
physical phone?

I haven't timed it yet, but, while the ARM emulation is dog slow...
http://www.bild.me/bild.php?file=4100603androidstudio07.jpg

The x86 emulation seems 'about the same' so far for me, but I haven't timed
it - but it's not egregious either way.
http://www.bild.me/bild.php?file=2999468androidstudio24.jpg

How is the emulation versus the real thing for you on speed?

The X220T came to me with a WWAN module installed and, presumably
working. To fit the mSATA boot SSD, this had to be removed to free the
slot.
As soon as I started trying to get the emulator to work, there were
error messages relating to the WWAN. I assume the emulator was trying to
connect to the phone components of the laptop. I have now removed all
the WWAN related software on the machine, but the emulator still doesn't
fully appear. I get the surround, but with a transparent screen.


That's interesting.

I haven't actually "played" with the emulated phone yet.
It would be interesting to see "what" it does, in terms of functionality,
e.g., it would be _great_ if it can make actual phone calls (but I suspect
it can't).

Like you ... right now ... I'm just dealing with getting the basics going,
where the difference between you and me is that I had some hell to learn
about getting emulation working on older AMD-based Windows where you
skipped that hell because you're on an Intel-based Windows. (Lucky you!)

In a posteriori 20/20 hindsight, I'd suggest that noobs _start_ on
Intel-based CPUs (if they can), or, if they can't, to start on _newer_
AMD-based CPUs.

Or, if they're on older AMD-based CPUs, to just run apps on a spare phone!
That why they'd skip the emulator hell I went through.

BTW, Bill ... I don't remember if you said whether you're using a spare
phone or if you're running on your main phone?

I don't have a spare phone with a good screen (I crushed them all,
literally), so I only have two choices:
o Load all those apps onto my main phone, or,
o Run everything in emulation

Do you run on a spare phone or your main phone?

There hasn't been time to do much more. I'm still on the text based app.


Now that I've gotten past the AMD-specific horrors, I can try to at least
"catch up" to you.

I'll post back when I have something to report of interest to all.
http://www.bild.me/bild.php?file=2596267androidstudio06.jpg
  #49  
Old November 7th 18, 05:39 PM posted to comp.mobile.android,alt.comp.freeware,microsoft.public.windowsxp.general
Bill[_40_]
external usenet poster
 
Posts: 346
Default Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)

In message , Arlen_Holder
writes
On Tue, 6 Nov 2018 16:58:26 +0000, Bill wrote:

The X201 seems to be working well and the emulator is fine. There is a
warning about the display drivers, but I have a good display.


I too get a bunch of warnings, but everything is working so I'm not even
looking at those warnings.

I'm curious, Bill ... does your emulation work about the same speed as your
physical phone?

I haven't timed it yet, but, while the ARM emulation is dog slow...
http://www.bild.me/bild.php?file=4100603androidstudio07.jpg

The x86 emulation seems 'about the same' so far for me, but I haven't timed
it - but it's not egregious either way.
http://www.bild.me/bild.php?file=2999468androidstudio24.jpg

How is the emulation versus the real thing for you on speed?

I haven't really checked any speeds. The emulation seems quite slow to
appear, but, because I've stayed with the text instructions, I haven't
actually got any buttons to press that do anything on the emulator. I am
still stuck where I enter the java message stub under the heading "Start
another activity". I haven't had much time and have spent it mainly
trying to get the instance of the program on the other machine - with
default settings everywhere - working.

The X220T came to me with a WWAN module installed and, presumably
working. To fit the mSATA boot SSD, this had to be removed to free the
slot.
As soon as I started trying to get the emulator to work, there were
error messages relating to the WWAN. I assume the emulator was trying to
connect to the phone components of the laptop. I have now removed all
the WWAN related software on the machine, but the emulator still doesn't
fully appear. I get the surround, but with a transparent screen.


Further to that, there is a transient error message that appears, but it
is beneath the visible parts of the emulator, and I haven't managed to
move the emulator to see the message. I have run Sysinternals Process
Monitor, which shows a bunch of entries like this.

" 23:55:27.9635626 emulator64-crash-service.exe 6968 CreateFile
C:\Windows\Prefetch\EMULATOR64-CRASH-SERVICE.EXE-C784D2C2.pf NAME NOT
FOUND Desired Access: Generic Read, Disposition: Open, Options:
Synchronous IO Non-Alert, Attributes: n/a, ShareMode: None,
AllocationSize: n/a "

but I haven't investigated further.


Snip about cpu types

BTW, Bill ... I don't remember if you said whether you're using a spare
phone or if you're running on your main phone?

I don't have a spare phone with a good screen (I crushed them all,
literally), so I only have two choices:
o Load all those apps onto my main phone, or,
o Run everything in emulation

Do you run on a spare phone or your main phone?


I have a spare Android 6 phone that I've been using. I also have an
Android 4 phone and a couple of Android 4 tablets, but haven't tried any
of these. ( I've kept them all because each has a special feature eg an
A4 tablet receives off air TV)

There hasn't been time to do much more. I'm still on the text based app.


Now that I've gotten past the AMD-specific horrors, I can try to at least
"catch up" to you.

"Catch up" is not the right phrase!

I will probably concentrate on the machine where the emulator works,
concentrate on getting the java to work, and then look at where to go
from there. I think the timer app is a great basic thing to aim for, and
have at least one idea of my own for a further "one button" app.
--
Bill

---
This email has been checked for viruses by AVG.
https://www.avg.com

  #50  
Old November 8th 18, 10:59 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 Tue, 6 Nov 2018 09:26:01 -0000 (UTC), Arlen_Holder wrote:

With experience of 20:20 hindsight, even on old AMD CPUs, it's that easy!


Woo hoo!

Now that I finally was able to get the Microsoft Emulator working with
Android Studio 3.2.1 on an old AMD-based Windows desktop, I was able to
easily run the official Google Android Studio "Your first app" tutorial to
completion:
https://developer.android.com/training/basics/firstapp/

o The app running in a Nexus 7 emulation displays a screen for text input:
http://www.bild.me/bild.php?file=5614359androidstudio42.jpg
o You enter any desired text and hit the "Send" button:
http://www.bild.me/bild.php?file=1062599androidstudio43.jpg
o That sends the text to the next level (where all the back buttons work):
http://www.bild.me/bild.php?file=6870342androidstudio44.jpg

That seems to be the ONLY step-by-step tutorial on those web page (but
maybe I need to root around more?).

Given I'm an average noob (if even that), I wish I could speak with the
writer where what I would tell her would IMPROVE the tutorial for noobs
without adding any complexity.

I suspect it would take her a half hour on the phone to hear me out, and
then another few hours to make her edits, and those improvements alone
would be exponentially better.

Anyway, the first Android Studio tutorial is successfully completed, such
that the app works for what it was intended to do.

For those of you who have never created an Android app, this method of
handholding works, where the hardest part for me was completely unrelated
to the tutorial itself - but was a hardware/software configuration issue
which only shows up on AMD-based systems.
  #51  
Old November 8th 18, 11:24 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 Wed, 7 Nov 2018 16:39:06 +0000, Bill wrote:

I haven't really checked any speeds.


Hi Bill,

Good news!

Now that I got all the old-AMD-induced emulations problems worked out,
I just completed the official Android Studio "My First App" tutorial:
https://developer.android.com/training/basics/firstapp/
Where the emulation speed is "about the same" as the physical speed,
although, again, I haven't timed it with a stopwatch, and I'm counting
assuming the emulator is already up and ready to take files just as a phone
would be as it's connected via USB to the computer.

The emulation seems quite slow to
appear, but, because I've stayed with the text instructions, I haven't
actually got any buttons to press that do anything on the emulator.


In that first app, there are only three buttons that you can test.
o One is called "Send", which will send the text to the next screen
o The other two are the top & bottom "back" buttons on the second screen

Here is a set of screenshots showing those events on the MS emulator:
o The app running in a Nexus 7 emulation displays a screen for text input:
http://www.bild.me/bild.php?file=5614359androidstudio42.jpg
o You enter any desired text and hit the "Send" button:
http://www.bild.me/bild.php?file=1062599androidstudio43.jpg
o That sends the text to the next level (where all the back buttons work):
http://www.bild.me/bild.php?file=6870342androidstudio44.jpg

I am
still stuck where I enter the java message stub under the heading "Start
another activity". I haven't had much time and have spent it mainly
trying to get the instance of the program on the other machine - with
default settings everywhere - working.


Here are the two main java files which worked for me.
==========
C:\tmp\android\app02\app\src\main\java\com\kiss\ap p02\MainActivity.java
==========
package com.kiss.app02;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {
public static final String EXTRA_MESSAGE =
"com.example.myfirstapp.MESSAGE";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

/** Called when the user taps the Send button */
public void sendMessage(View view) {
Intent intent = new Intent(this, DisplayMessageActivity.class);
EditText editText = (EditText) findViewById(R.id.editText);
String message = editText.getText().toString();
intent.putExtra(EXTRA_MESSAGE, message);
startActivity(intent);
}
}
==========
C:\tmp\android\app02\app\src\main\java\com\kiss\ap p02\DisplayMessageActivity.java
==========
package com.kiss.app02;

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

public class DisplayMessageActivity extends AppCompatActivity {

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

// Get the Intent that started this activity and extract the string
Intent intent = getIntent();
String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);

// Capture the layout's TextView and set the string as its text
TextView textView = findViewById(R.id.textView);
textView.setText(message);
}
}
==========
I have a spare Android 6 phone that I've been using. I also have an
Android 4 phone and a couple of Android 4 tablets, but haven't tried any
of these. ( I've kept them all because each has a special feature eg an
A4 tablet receives off air TV).


Thanks for letting me know you've been emulating but that you can run the
apps on the phones. My main warning to you on running the apps on the
phones is that it clutters them up with your test apps, but otherwise I
have run all the test on the physical phone and it works just fine either
way (on the emulator, or on the phone).

The emulator is more convenient because I can pick any emulator I want.

I will probably concentrate on the machine where the emulator works,
concentrate on getting the java to work, and then look at where to go
from there.


Let me know if you need me to post any code for you.

These are most likely the six files that you may want to look at:
C:\tmp\android\app02\app\src\main\java\com\kiss\ap p02\MainActivity.java
C:\tmp\android\app02\app\src\main\res\layout\activ ity_main.xml
....
C:\tmp\android\app02\app\src\main\java\com\kiss\ap p02\DisplayMessageActivity.java
C:\tmp\android\app02\app\src\main\res\layout\activ ity_display_message.xml
....
C:\tmp\android\app02\app\src\main\AndroidManifest. xml
C:\tmp\android\app02\app\src\main\res\values\strin gs.xml
....

BTW, I'm curious what happens when you doubleclick on those *.java
and *.xml files. What editor comes up for you? Can you change that editor?

I think the timer app is a great basic thing to aim for, and
have at least one idea of my own for a further "one button" app.


I think it would be great if we both work on a simple timer app as our
first app that strays off the trail that the tutorials provide to us.

The timer seems simple enough in that you hit an icon, and ten minutes
later a timer rings. It would have utility to millions of people as the
_simplest_ timer on the planet!

My intention, if I ever develop apps, would be that they be
o Always free
o Always ad free, cloud free, spyware free, permission free, etc.
o And that they perform a simple KISS functionality

That's why I named the "company" field "kiss".
  #52  
Old November 8th 18, 06:45 PM posted to comp.mobile.android,alt.comp.freeware,microsoft.public.windowsxp.general
Bill[_40_]
external usenet poster
 
Posts: 346
Default Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)

Hi Arlen, It seems to me that the tutorial has mistakes and is
misleading! I think by adjusting my code to yours, I have cleared all
the errors.

Re the tutorial, this is what I would like to concentrate on, if I may:

In message , Arlen_Holder
writes
Here are the two main java files which worked for me.
==========
C:\tmp\android\app02\app\src\main\java\com\kiss\a pp02\MainActivity.jav
a


That line seems similar to mine.
==========
package com.kiss.app02;

import android.content.Intent;


I don't have this import, but maybe that comes later.

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

Check, same here. I then have, and don't know where it has come from,

import static android.icu.lang.UCharacter.GraphemeClusterBreak.V ;

import android.widget.EditText;

Maybe comes later.
public class MainActivity extends AppCompatActivity {


Check
public static final String EXTRA_MESSAGE =
"com.example.myfirstapp.MESSAGE";


Not there yet presume OK

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

Check

/** Called when the user taps the Send button */
public void sendMessage(View view) {


I have fun sendMessage(view: View){
*cf what the tutorial says. View and view are in reverse order, with a
colon between and "fun" is referred to in the code in the tutorial that
says
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
*

Intent intent = new Intent(this, DisplayMessageActivity.class);
EditText editText = (EditText) findViewById(R.id.editText);
String message = editText.getText().toString();
intent.putExtra(EXTRA_MESSAGE, message);
startActivity(intent);

These 5 lines will, I hope appear later
}
}


I haven't yet tried to progress any further (lack of time - we have a
lot of family matters here), but would be interested to know how, for
example, you came to reverse View and view.

The external editor I'm using is Notepad++. I had difficulty making it
the default editor on the Windows 10 machine, but by digging through the
Settings menu to the "Default Options by File type" and then pointing it
to the Notepad++ .exe file.
I understand there is an intermittent bug in W10 that stops Notepad++
being selected and retained, but it worked here. They seem to be raking
out the good bits of Control Panel and gradually destroying it.

I will try to catch up over the next few days. Many thanks for getting
me past this problem.
--
Bill

---
This email has been checked for viruses by AVG.
https://www.avg.com

  #53  
Old November 8th 18, 08:27 PM 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 Thu, 8 Nov 2018 17:45:16 +0000, Bill wrote:

Hi Arlen, It seems to me that the tutorial has mistakes and is
misleading! I think by adjusting my code to yours, I have cleared all
the errors.


Hi Bill,

That's *fantastic* that the code helped you clear the errors!
I'm always all about helping people help each other working together!

Hence, I'm very glad I could help, as that's the whole point of Usenet!
People helping each other, where, in this case, we're both noobs!

I'm not afraid to admit that it took me three or four runs (maybe even
more, as I didn't count them) through the tutorial myself before I had a
successful outcome.

So we're both in the same boat!

[As an aside, the people to be afraid of are the ones who can't admit that
they're noobs!]

import android.content.Intent;


I don't have this import, but maybe that comes later.


I agree these "import" lines are tricky.
I'm not sure what they really mean yet though.

import static android.icu.lang.UCharacter.GraphemeClusterBreak.V ;


The problem with the import lines is that you can accidentally add them
very easily, since the Android Studio practically writes the code for you.

For an example, if you type a letter, and then hit tab, it will auto fill
out a lot of the time (if it matches stuff) and then if you hit return, a
bunch of automatic things just happen. So it's very very very easy to add
stuff you may not have meant to add, simply by hitting simple keys like tab
and return!

I think I realize, looking at what you wrote, is that I gave you my *final*
code, but I should have given you the code at the exact point where you are
in the tutorial.

Can you tell me the link again, so that I'm sure exactly which page in the
tutorial you are stuck at?

o Page 1 of 5: Build your first app
https://developer.android.com/training/basics/firstapp/
o Page 2 of 5: Create an Android project
https://developer.android.com/training/basics/firstapp/creating-project
o Page 3 of 5: Run your app
https://developer.android.com/training/basics/firstapp/running-app
o Page 4 of 5: Build a simple user interface
https://developer.android.com/training/basics/firstapp/building-ui
o Page 5 of 5: Start another activity
https://developer.android.com/training/basics/firstapp/starting-activity

Maybe I can re-run the tutorial and stop at _that_ page for you to show the
code, where we can presume that noobs following in our footsteps will have
the exact same issues that you're having.

I haven't yet tried to progress any further (lack of time - we have a
lot of family matters here), but would be interested to know how, for
example, you came to reverse View and view.


I am also only working on this sporadically. There may be a day or two
between efforts, or maybe only ten minutes between efforts.

I did run a test this morning where it took 26 seconds from the time I hit
run to the time that the display showed up on the Microsoft emulator. I
then ran that test again where the device under test was the phone, which
took about the same amount of time (give or take a second or two).

So, at this stage, I'm going to mostly run on emulation since it clutters
up my extremely neat phone desktop screen otherwise.

The external editor I'm using is Notepad++. I had difficulty making it
the default editor on the Windows 10 machine, but by digging through the
Settings menu to the "Default Options by File type" and then pointing it
to the Notepad++ .exe file.


Ah. My default text editor is gVIM (because I grew up on UNIX), where
Windows just will NOT accept gVim as the default text editor for either XML
or java files!
o What editor do you use to edit "java" & "xml"
http://www.pcbanter.net/showthread.php?t=1106289

Most Windows users seem to be on the same editor you're on, so that's good
for you that you can get a doubleclick to open the files in your editor.

I will try to catch up over the next few days. Many thanks for getting
me past this problem.


If you can find another tutorial for both of us to try, Bill, that would be
useful as we can do it at the same time (where, as a result, anyone reading
this thread, now or in the future, can benefit).

[That's the entire point of Usenet, after all. Helpful collaboration.]

Meanwhile, I ran that Bill Butterfield tutorial (for the third or fourth
time) this morning where I re-did the adder that I had created last time
(but which I had deleted in my clean-slate wipeouts as I organized the
files).

Just as like what happened with the original Google "Hello World" tutorial,
each time I run though this Bill Butterfield tutorial, I get fewer and
fewer and fewer mishaps - and things work faster and faster and faster.

This last rev took less than a half hour (or so ... as I wasn't counting).

Here is a screenshot of the adder app that resulted from that tutorial:
http://www.bild.me/bild.php?file=8515596androidstudio46.jpg

You'll note I positioned the buttons differently but that is just window
dressing. I moved them up because the keyboard kept getting in the way on
the phone (but not in the emulation, oddly enough).

It's the "Android Studio For Beginners Part 1", by Bill Butterfield.
o Published on Jun 13, 2017 (mp4)
o https://youtu.be/dFlPARW5IX8 (part 1 of 4)
===========
Here's the java code (so that you and others can use it directly)
C:\tmp\android\app03\app\src\main\java\com\kiss\ap p03\MainActivity.java
===========
package com.kiss.app03;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

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

Button addBtn = (Button) findViewById(R.id.addBtn);
addBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
EditText firstNumEditText = (EditText)
findViewById(R.id.firstNumEditText);
EditText secondNumEditText = (EditText)
findViewById(R.id.secondNumEditText);
TextView resultTextView = (TextView)
findViewById(R.id.resultTextView);

int num1 =
Integer.parseInt(firstNumEditText.getText().toStri ng());
int num2 =
Integer.parseInt(secondNumEditText.getText().toStr ing());
int result = num1 + num2;
resultTextView.setText(result + "");
}
});

}
}
===========
Here's the xml layout (so that you and others can use it directly)
C:\tmp\android\app03\app\src\main\res\layout\activ ity_main.xml
===========
?xml version="1.0" encoding="utf-8"?
android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
tools:layout_editor_absoluteY="81dp"

android.support.constraint.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content
===========

With respect to my positioning the buttons differently from the tutorial:
http://www.bild.me/bild.php?file=8515596androidstudio46.jpg

Two things I learned (which is why I repositioned the buttons):
1. The keyboard acts slightly differently in emulation because the emulator
uses your real keyboard and not a pop-up keyboard (which the phone uses).
2. On the phone, I need a way to make the keyboard go away in the app, so
as to eliminate the step of closing the keyboard manually.
  #54  
Old November 8th 18, 09:43 PM posted to comp.mobile.android,alt.comp.freeware,microsoft.public.windowsxp.general
Bill[_40_]
external usenet poster
 
Posts: 346
Default Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)

In message , Arlen_Holder
writes
Page 5 of 5: Start another activity

https://developer.android.com/traini...arting-activit
y


I'm part way down this page, and have adjusted the files so they build
without errors.
This is all I will have time for today and tomorrow morning we have a
bricklayer coming to take down and rebuild the gatepost I hit with the
car. The forecast is gales and torrential rain.

I don't want to create any work for you or anyone, so I need to reach
the next snag before asking again, hence this quick and short reply!
--
Bill

---
This email has been checked for viruses by AVG.
https://www.avg.com

  #55  
Old November 9th 18, 12:40 PM 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 Thu, 8 Nov 2018 20:43:35 +0000, Bill wrote:

I'm part way down this page, and have adjusted the files so they build
without errors.


Hi Bill,
Thanks for letting me know you're doing fine with that first app!
(It makes me feel good to have helped you, as you had also helped me.)

I'll be working on the next video in the Bill Butterfield series when I get
the chance, and where I'll report back if I have something to report of
general use to anyone else who is following along writing their own apps.

BTW, there must be some "magic" that needs to be added (later) to enable
the APK to be installed by others!

I ran this experiment just now, which failed:

1. On the phone, I wiped out all my recently installed "appxx" apps.
2. On the desktop, I used the Android Studio IDE to put app03 on my phone
3. On the phone, I backed up app03 to the APK for app03.apk
4. On the phone, I wiped out the app "app03"
5. On the phone, I tried to re-install from the backed-up app03.apk
6. That failed, saying... "The package appears to be corrupt"
http://www.bild.me/bild.php?file=5351195apk.jpg

Hmmmmnmnmmm....

The app03 worked just moments prior ¡K
So, the app-to-apk-back-to-app process may need "fancy stuff".
  #56  
Old November 10th 18, 04:24 AM posted to comp.mobile.android,alt.comp.freeware,microsoft.public.windowsxp.general
Diesel
external usenet poster
 
Posts: 937
Default Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)

Arlen_Holder
news alt.comp.freeware, wrote:

On Tue, 6 Nov 2018 09:26:01 -0000 (UTC), Arlen_Holder wrote:

With experience of 20:20 hindsight, even on old AMD CPUs, it's
that easy!


Woo hoo!

Now that I finally was able to get the Microsoft Emulator working
with Android Studio 3.2.1 on an old AMD-based Windows desktop, I
was able to easily run the official Google Android Studio "Your
first app" tutorial to completion:


That's great Arlen. It only took you over twenty (right?) repeat
installations of the software packages, likely hours spent online
'researching' your AMD based system so that you could eventually make
the proper adjustments, and, a sorted collection of completely
unnecessary posts to usenet, detailing your progress (or rather, lack
of for a considerable period of time).

For comparison, Arlen...

Someone who's interested and/or has developed software in various
other languages for sometime is likely to be familiar enough with the
host environment (that's a combination of the software and the
hardware, Arlen) to successfully install and make use of (very
important the latter, wouldn't you agree?) the programming
environment (let's just call it compiler for short, ok?) on the first
try.

I have a theory as to why it took you as much time as it did and as
much hand holding as you could acquire, here and elsewhere. It's
based entirely on prior/current interactions with you, here in
usenet. AFAIK, I don't know you in any way outside of usenet.

Here's my theory...

I believe that you're so arrogant that you feel as if it's never
necessary to read the instructions, or even give them so much as a
glance over before you jump right in, expecting excellent results, on
the first attempt.

Here's a simple example, Arlen. It's important, in some cases Arlen,
to *know* what the hardware is inside the box you're using. It *does*
matter. As you've discovered. Not only did you waste a significant
amount of your time, you wasted a small amount of mine as well... And
reinforced what I've been told since I was a child concerning making
assumptions about what someone does/doesn't know. I *assumed* you
(based on your boasting) atleast knew enough about the machine you
were doing this with to know what it physically did/didn't support
and had already made the proper configuration adjustments.

I made the mistake of thinking (not paying attention to the fact you
didn't know what HAXM is...*sigh*) that you were far enough along in
the program that you had the proper settings to match your hardware
and were still stuck. Had that been the problem and you were
experiencing what the registry key addresses, it *would have* got you
up and going. You forget Arlen, I work on systems for a living,
professionally. I don't have time to **** around or play games with
people, and, I'm not about to give you bad advice/information
intentionally in any way shape or form. I worked hard to regain some
trust by some people, and, I'm watched (hehehe) very closely by some
naysayers just to see if I try to do something shady to someone;
and/or talk them into screwing themselves.

You might very well have been on usenet for decades as you've
claimed, but, it wasn't in the newsgroups you've been haunting as of
late; You'd have (or should I think!) have a good idea who I am by
now and wouldn't be playing silly games with me...

The registry fix I suggested for you still applies, and, I'd still
advise for you and Bill to properly create it. A computer is a very
complex piece of machinery; the software is yet another layer of
complexity. Just because neither of you has or can find the key in
your registry and everything appears to be 'just fine', doesn't mean
nor should it be misunderstood to be the case.


--
To prevent yourself from being a victim of cyber
stalking, it's highly recommended you visit he
https://tekrider.net/pages/david-brooks-stalker.php
================================================== =
Murphy's Law only fails when you try to demonstrate it.
  #57  
Old November 10th 18, 08:04 AM posted to comp.mobile.android,alt.comp.freeware,microsoft.public.windowsxp.general
Diesel
external usenet poster
 
Posts: 937
Default Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)

Arlen_Holder
news alt.comp.freeware, wrote:

On Sat, 10 Nov 2018 03:24:33 -0000 (UTC), Diesel wrote:

I believe that you're so arrogant that you feel as if it's never
necessary to read the instructions, or even give them so much as
a glance over before you jump right in, expecting excellent
results, on the first attempt.


Hi Diesel,
Thanks for your kind advice where you are far more experienced
than I. I'm a noob. I never said I wasn't a noob. So let's be
clear: I'm a noob.


You keep changing your position on that, Arlen. It's the second time
you've admitted that you're nowhere near me in so far as skillset
and/or knowledge is concerned, yet you tried to mock me (again) with
a reply to another poster...I know you're in no position to do that
and be able to back any of it up, but, I enjoy reminding you of your
dishonesty, since you like to claim you only deal in facts. Clearly,
you don't.

Unfortunately, since I have an old AMD-based Windows desktop, I
have been successful using the Microsoft Android Emulator, which
is working astoundingly perfectly, which allows me to test any
Android phone or tablet that I want to test with any Android API.


You chose to purchase a piece of **** without knowing what was under
the hood. Like so many (Don't get me wrong, I make good money
repairing name brand junk) others who are brand loyal. All of that
aside, Your AMD powered machine most certainly can run Android
emulators and various other kinds of emulation, should you so desire.
I have a single remaining Much older than yours AMD machine here.
I've already performed various tests with it, attempting to duplicate
the issue you were experiencing previously.

I wasn't able to duplicate the issue you experienced because unlike
you, I know what the machine is and configured it beforehand.
Something you didn't do, for atleast twenty! reinstallations that you
yourself admit to having to do. That's alot of reinstalls and time
wasted because you didn't understand what your machine was on the
hardware level and let's be honest, Arlen, didn't have a clue what
you were attempting to do.

You've managed to do a bit of fishing though with the thread and have
succesfully reeled in one person who's willing to ignore what many
others have written concerning you (along with what I've written) and
proceed to disregard all of that (including taking all of this
nonsense to email) and exchange 'programming 101' tips with you here.
So, I congratulate you for that, and to answer another posters
question, yes, there's enough suckers that you won't exhaust the
supply anytime soon.

The registry fix I suggested for you still applies, and, I'd
still advise for you and Bill to properly create it.


Thanks for your advice on that registry fix.


Which you've prompty disregarded for the second or third time now.
It's probably just as well since you demonstrated a clear inability
to follow very simple directions and weren't able to create the key
with the proper setting anyway.

All the documentation you referenced (which I saw also of course),
was with respect to getting the Visual Studio to work with the
Microsoft Android Emulator.


Some of what you're calling documentation is from my own notes which
haven't been published to the internet, so, contrary to what you've
written (you lied again, Arlen) you haven't 'also seen it'.

None of that documentation was for getting the Android Emulator to
work with Android Studio, AFAIK.


As I said, I don't know what documentation you're specifically
referencing and I'm not all that interested in arguing with a n00b
who can't set a simple registry key why they should have done so, but
I'm not going to spend alot of time trying to convince you to set the
key, either. if you feel you don't need it, and have already shown
you don't know how to work with the system registry, that's okay with
me. From my pov, everything looks great from my house.

A computer is a very
complex piece of machinery; the software is yet another layer of
complexity.


The good news is that I've figured out, today, how to copy a
project, which, if anyone here has ever tried it, is _not_
intuitive.


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.

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

In fact, just like everyone with older AMD had problems
getting the Google emulators to work, everyone who copies a
project has problems getting Android Studio to _recognize_ that
copied project.


There's no such fact. Not everyone had problems getting the emulators
to work on an AMD based system. The ONLY people who had trouble
getting it up and running from what I read are those who didn't know
what the hardware was and so, didn't set it up properly to run the
emulation software they elected to play with. Don't assume 'everyone
with older AMDs' had problems when infact, not everyone did.

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

It took a few hours, but I got further than most people who just
gave up.


It took more than a few hours, Arlen. There's no need for you to be
that dishonest. Naturally, you got further than anyone who gave up;
because (drum roll) they gave up. Had they bothered to do a little
more digging, they would have gotten it up and running too.

It's just as well they gave up on such a simple process as they would
have made for rather lousy programmers since they couldn't solve a
relatively simple (contrary to what you've claimed repeatedly) issue
of emulator installation and proper configuration.

The reason a copy of a project is important is for these
multi-step tutorials, at the end of one 5-part tutorial, you have
app03, for example, which is the beginning of part two.


Arlen, I have alot more experience writing code for the masses than
you do, so, I don't require a history lesson in why you'd be doing
what you are doing now. It's NOT NEW to me. I've been doing this for
years. It's not exclusive to Android or any particular programming
environment either, it's just good coding practice.

Well - you don't know how complex that turns out to be until
you've done it!


Come back to me with how complex something turns out being when
you're looking at hundreds of thousands of lines of code in the main
project source and several thousands of lines of code in each
external module that was compiled seperatly but will become part of
the main program as part of the compiling process on the main source
code. When you've written apps like that, then you can make
suggestions on how to improve the process and/or claim (rightfully)
how complicated the process can be.

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. And, instead of taking selfies for attention like an attention
starved teenager, you're wasting peoples time on usenet with stupid
threads like this one. End result for you is the same, attention
cravings satisfied.

In 20/20 hindsight, you might not want to even _think_
about it, but I didn't know that when I first tried it.
But I was just now completely successful in doing that simple task
(which almost nobody knows how to do, it turns out).


almost nobody who Arlen? Other n00bs to the world of coding like
yourself?

For Bill, and for the tribal record, if anyone is interested in


Why not just initiate the rest of this nonsense with Bill via email?
Or perhaps realtime via irc? There's no need for you to share
hundreds of lines of text to describe something to one individual who
has taken interest in what you're doing. Nobody else seems to be
interested in your troubles or boring diary/journal of your
failures/suggestions based on ignorance, etc.

for the first time now ... so as I copy more and more projects,
I'll hone it down to the steps that it needs to be.


Jesus, please, don't.

Needless to say, nobody on this planet knows of Google
documentation on this topic - which is sorely needed - as it's not
unheard of to want to copy app03 to app04 and have it work as
app04, particularly when you're learning, as I am...


What you're reinventing yet again Arlen is old hat, and old news to
people who actually have a programming background that they've stuck
with. IE: didn't have a passing interest for work related only like
you did.

================================================== =================
======== The next time I try this, I'll try to streamline the
steps so that everyone else will benefit from the time and energy
I spent on this to document it thoroughly.


Who's everyone Arlen? Why do you continue to avoid that question and
the majority of questions I ask of you? I can't help but notice you
tend to avoid questions presented by other posters as well. That's
not a very professional stance to take, Arlen. Especially when you
consider that you're essentially flooding somewhat various newsgroups
with crossposted threads you've created for your own personal
benefit; if you can catch a fish willing to help you.

And that's exactly what you're doing with this thread and the
previous ones.




--
To prevent yourself from being a victim of cyber
stalking, it's highly recommended you visit he
https://tekrider.net/pages/david-brooks-stalker.php
================================================== =
I tried being reasonable once. I didn't like it.
  #58  
Old November 10th 18, 10: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
  #59  
Old November 10th 18, 11:34 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 Fri, 9 Nov 2018 11:40:39 -0000 (UTC), Arlen_Holder wrote:

The app03 worked just moments prior ¡K
So, the app-to-apk-back-to-app process may need "fancy stuff".


Hi Bill,

Woo hoo! I did that second Bill Butterfield tutorial which
worked the first time (after minor syntax mistakes).

Definitely never START with that second video, as he goes a _lot_
faster than he did with the first video - so do the first video
first (even though you can tell he recorded them in the opposite
order).

I finally figured out that app porting stuff, where, it turns out to
be something we don't need yet, so you can completely skip porting of
your apps (where I ported app03 to app04 but getting it working took
hours because of bugs inside of the Android Studio code):
http://www.bild.me/bild.php?file=7456135androidstudio58.jpg

I moved to the second video, part 2, by Bill Butterfield,
of the set "Android Studio For Beginners Part 1,2,3,4":
https://youtu.be/dFlPARW5IX8 (part 1) === app03 is this video
https://youtu.be/6ow3L39Wxmg (part 2) === app05 is this video
https://youtu.be/rdGpT1pIJlw (part 3)
https://youtu.be/bu5Y3uZ6LLM (part 4)

Here is the result on my phone:
http://www.bild.me/bild.php?file=8495103androidstudio57.jpg

o The app opens up to two buttons:
http://www.bild.me/bild.php?file=6279919androidstudio54.jpg
o When you press one button, it opens up another activity inside the app.
(This INSIDE activity just says "hello world" for now.)
http://www.bild.me/bild.php?file=5901351androidstudio55.jpg
o When you press the other button, it opens up an activity outside the app
(This OUTSIDE activity just goes to a web browser with a hard-coded URL)
http://www.bild.me/bild.php?file=5790092androidstudio56.jpg

I am not sure why that web browser call failed, but I tried to run a
call from inside the web browser in the emulator, and it failed too,
so maybe we need to do something so that the emulator web browser
can get onto the Internet? I don't know, but it doesn't matter because
it worked just fine on the phone (which is what really matters).

It's a nice learning tool, actually, because it's a good framework.
Here is my working code, if you or anyone else wants or needs it.
================================================== ==========================
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\res\layout\activ ity_main.xml
================================================== ==========================
?xml version="1.0" encoding="utf-8"?
android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"

Button
android:id="@+id/secondActivityBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Second Activity"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /

Button
android:id="@+id/googleBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="8dp"
android:text="Google"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/secondActivityBtn" /
/android.support.constraint.ConstraintLayout
================================================== ==========================
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);
}
}
}
================================================== ==========================
C:\tmp\android\app05\app\src\main\res\layout\activ ity_second.xml
================================================== ==========================
?xml version="1.0" encoding="utf-8"?
android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SecondActivity"

TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /
/android.support.constraint.ConstraintLayout
================================================== ==========================
Here's an example of the code when it runs on my phone (Nougat):
http://www.bild.me/bild.php?file=8495103androidstudio57.jpg
================================================== ========================
  #60  
Old November 10th 18, 11:43 AM posted to comp.mobile.android,alt.comp.freeware,microsoft.public.windowsxp.general
Bill[_40_]
external usenet poster
 
Posts: 346
Default Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)

In message , Arlen_Holder
writes
Thanks for letting me know you're doing fine with that first app! (It
makes me feel good to have helped you, as you had also helped me.)


OK, call me stupid! I have only just sussed out that, in the text based
"official" first app, the words KOTLIN and JAVA above the code were
actually switches that select the code shown by the website. So I've
been trying to understand why code for Kotlin (which I suppose I'll have
to research) didn't work in Java.

I've been trying to look up java words and phrases as I've come across
them. It was trying to understand "val" that led me up various garden
paths before I finally came to.
It possibly doesn't help that my main java book (remember them?) is
dated 2002.
I am still surprised that there appears to be no sort of forum catering
for Android Studio, and how I still haven't found any living java usenet
lists.

I have now got through the text based button and message build, which
works, and am starting on the first Butterfield video.
--
Bill

---
This email has been checked for viruses by AVG.
https://www.avg.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 11:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.