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. |
|
|
Thread Tools | Display Modes |
#76
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
On Wed, 14 Nov 2018 17:55:38 +0000, Bill wrote:
Most of the work done last night in Android Studio was no longer there, so I'll have to do it all over again tonight. I know I should have done a "save all" before shutting the lid, and should be taking backups very frequently, but it still doesn't stop me being mad at Microsoft. Hi Bill, I'm sorry for you on losing all your work. It happened to me quite a few times, although for different reasons, as I reinstalled my Android Studio and moved directories around, and changed locations of SDKs and JDKs, etc., some of which screwed everything up. In the future, there are a few ways to prevent that loss of all your work. One, of course, which you found, is AndroidStudio321:File Save All (control+s) Another save method is to export to a zip file: AndroidStudio321:File Export to zip file Later, when we get good at trusting Android Studio, we can use the built-in version-control menu system AndroidStudio321:VCS Import into version control A method I use a lot lately is to right click in Windows file explorer and just zip it up whenever I want to create a checkin point, where there is app08_a.zip, app08_b.zip, app08_c.zip, etc.. This way I can get back to where I last was if/when I screw up. BTW, once I figured out how to port app06 (grocery list) to app08, changing that grocery list to handle any number of items was trivial. These are real items, at my local grocery store, where I took pictures of what I normally buy there (i.e., the best deals). I'm curious how the prices are with respect to yours! o The shopping list GUI has the things I buy at this sto http://www.bild.me/bild.php?file=2882721androidstudio63.jpg o The list scrolls for as long as needed to contain the list: http://www.bild.me/bild.php?file=6444469androidstudio64.jpg o The first item is the bar of pure chocolate, at $6/pound: http://www.bild.me/bild.php?file=8761584androidstudio65.jpg o Then the cage-free eggs, at $2/dozen: http://www.bild.me/bild.php?file=4179147androidstudio66.jpg o The free-roaming cow's whole milk, at $3/gallon: http://www.bild.me/bild.php?file=4022187androidstudio67.jpg o Fresh squeezed orange juice at $3/half gallon: http://www.bild.me/bild.php?file=1358712androidstudio68.jpg o Durham and Seminole wheat pasta at $1/pound: http://www.bild.me/bild.php?file=7272961androidstudio69.jpg o Fresh squeezed pineapple juice at $3/half gallon: http://www.bild.me/bild.php?file=2910438androidstudio70.jpg o California table wine at about $6/750ml: http://www.bild.me/bild.php?file=2665618androidstudio71.jpg o Whole wheat organie olive oil bread wraps at $3.30/14.4 ounces: http://www.bild.me/bild.php?file=6075024androidstudio72.jpg |
Ads |
#77
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
On Thu, 15 Nov 2018 05:56:55 -0000 (UTC), arlen michael holder wrote:
These are real items, at my local grocery store, where I took pictures of what I normally buy there (i.e., the best deals). Hi Bill, Here's what the "custom" shopping list looks like on the phone: http://www.bild.me/bild.php?file=5881250androidstudio73.jpg The original design is pretty good because everything is just an item in a list, which can be of any length. Hence, the only files that changed to create that shopping list were C:\tmp\android\app08\app\src\main\res\values\strin gs.xml C:\tmp\android\app08\app\src\main\java\com\kiss\ap p08\DetailActivity.java Where these are the files: ================================================== ========================== I added the items to the "strings.xml" file: C:\tmp\android\app08\app\src\main\res\values\strin gs.xml resources string name="app_name"app08/string string-array name="items" itemchocolate/item itemeggs/item itemmilk/item itemorange juice/item itempasta/item itempineapple juice/item itemtable wine/item itembread wrap/item /string-array string-array name="prices" item$4.99/item item$1.69/item item$2.99/item item$2.99/item item$0.99/item item$3.99/item item$5.99/item item$3.29/item /string-array string-array name="descriptions" itemchocolate bar (no preservatives)/item itemdozen eggs (free roaming)/item itemgallon of milk (happy cows)/item item1/2 gallon of oj (fresh)/item itempound of pasta (semolina wheat)/item itemhalf gallon of pineapple juice (fresh)/item itemtable wine (California)/item itembread wrap (wheat)/item /string-array /resources ================================================== ========================== And I added the switches to the DetailActivity.java file: C:\tmp\android\app08\app\src\main\java\com\kiss\ap p08\DetailActivity.java package com.kiss.app08; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Display; import android.widget.ImageView; public class DetailActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); Intent in = getIntent(); int index = in.getIntExtra("com.kiss.app08.ITEM_INDEX", -1); if (index -1) { int pic = getImg(index); ImageView img = (ImageView) findViewById(R.id.imageView); scaleImg(img, pic); } } private int getImg(int index) { switch (index) { case 0: return R.drawable.chocolate; case 1: return R.drawable.egg; case 2: return R.drawable.milk; case 3: return R.drawable.oj; case 4: return R.drawable.pasta; case 5: return R.drawable.pj; case 6: return R.drawable.vino; case 7: return R.drawable.wrap; default: return -1; } } private void scaleImg(ImageView img, int pic) { Display screen = getWindowManager().getDefaultDisplay(); BitmapFactory .Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeResource(getResources(), pic, options); int imgWidth = options.outWidth; int screenWidth = screen.getWidth(); if (imgWidth screenWidth) { int ratio = Math.round( (float) imgWidth / (float)screenWidth); options.inSampleSize = ratio; } options.inJustDecodeBounds = false; Bitmap scaledImg = BitmapFactory.decodeResource(getResources(), pic, options); img.setImageBitmap(scaledImg); } } ================================================== ========================== The rest of the files were untouched from what they were in app06. C:\tmp\android\app08\app\src\main\java\com\kiss\ap p08\MainActivity.java package com.kiss.app08; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; public class MainActivity extends AppCompatActivity { ListView myListView; String[] items; String[] prices; String[] descriptions; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Resources res = getResources(); myListView = (ListView) findViewById(R.id.myListView); items = res.getStringArray(R.array.items); prices = res.getStringArray(R.array.prices); descriptions = res.getStringArray(R.array.descriptions); ItemAdapter itemAdapter = new ItemAdapter(this, items, prices, descriptions); myListView.setAdapter(itemAdapter); myListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView? parent, View view, int i, long l) { Intent showDetailActivity = new Intent(getApplicationContext(), DetailActivity.class); showDetailActivity.putExtra("com.kiss.app08.ITEM_I NDEX", i); startActivity(showDetailActivity); } }); } } ================================================== ========================== C:\tmp\android\app08\app\src\main\java\com\kiss\ap p08\ItemAdapter.java package com.kiss.app08; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; public class ItemAdapter extends BaseAdapter { LayoutInflater mInflator; String[] items; String[] prices; String[] descriptions; public ItemAdapter(Context c, String[] i, String[] p, String[] d) { items = i; prices = p; descriptions = d; mInflator = (LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE ); } @Override public int getCount() { return items.length; } @Override public Object getItem(int i) { return items[i]; } @Override public long getItemId(int i) { return i; } @Override public View getView(int i, View view, ViewGroup viewGroup) { View v = mInflator.inflate(R.layout.my_listview_detail, null); TextView nameTextView = (TextView) v.findViewById(R.id.nameTextView); TextView descriptionTextView = (TextView) v.findViewById(R.id.descriptionTextView); TextView priceTextView = (TextView) v.findViewById(R.id.priceTextView); String name = items[i]; String desc = descriptions[i]; String cost = prices[i]; nameTextView.setText(name); descriptionTextView.setText(desc); priceTextView.setText(cost); return v; } } ================================================== ========================== C:\tmp\android\app08\app\src\main\AndroidManifest. xml ?xml version="1.0" encoding="utf-8"? manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.kiss.app08" application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" activity android:name=".MainActivity" intent-filter action android:name="android.intent.action.MAIN" / category android:name="android.intent.category.LAUNCHER" / /intent-filter /activity activity android:name=".DetailActivity"/activity /application /manifest ================================================== ========================== |
#78
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
On Thu, 15 Nov 2018 01:24:05 -0000 (UTC), arlen michael holder wrote:
Save this as it is NOT anywhere else on the net, but here! Hi Bill, I accidentally found out something potentially interesting today, when I hit a button on Android while reproducing all the previous apps: http://www.bild.me/bild.php?file=7991068androidstudio75.jpg o I opened the Windows Android Studio "Device File Explorer": http://www.bild.me/bild.php?file=6942292androidstudio76.jpg o Amazingly, this displayed the root file system on Android: http://www.bild.me/bild.php?file=1162959androidstudio77.jpg o It "seems" to allow me to "edit" the root files (non rooted): http://www.bild.me/bild.php?file=1078724androidstudio78.jpg o Where it sure "looks" like we can edit root files, non root: http://www.bild.me/bild.php?file=1402992androidstudio79.jpg o But I'll need to test this further as it's unbelievable: http://www.bild.me/bild.php?file=2729035androidstudio80.jpg Since it's a holy grail to be able to write to the Android hosts file from Windows without being root ... I need to test this further. Certainly this web page "intimates" that we can WRITE a hosts file BACK to Android FROM Windows, without needing to be root on Android: https://www.modmy.com/how-modify-hosts-file-your-android-device The command that web page suggests is... C:\app\editor\android\sdk\platform-tools\adb.exe root push c:\windows\system32\drivers\etc\hosts /system/etc/ |
#79
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
On Mon, 12 Nov 2018 06:04:22 -0000 (UTC), Arlen_Holder wrote:
I'm not sure what app07 will be as I think the 4th video is out of context for what I'm planing on doing (ring an alarm as a 10-minute timer). Hi Bill, I left a placeholder for app07, because when I made app08, I realized instantly that it would be nice to populate the grocery list from a file on the net which the whole family can read and write to. So while I didn't do that last Butterfield tutorial yet (app07), I think I will eventually come back to it since it's essential to have a better database for populating things like grocery lists that the whole family can access. Meanwhile... thanks to all of Diesel's wonderful advice ... o For practice, I re-wrote all the apps, to reinforce concepts: http://www.bild.me/bild.php?file=7991068androidstudio75.jpg o The tutorials were MUCH EASIER to follw with my new 20/20 hindsight! http://www.bild.me/bild.php?file=7987464androidstudio74.jpg o They were even easy to customize so that I created my first 'app': http://www.bild.me/bild.php?file=5881250androidstudio73.jpg So the good news is that we're no longer complete & total noobs! We know enough now to at least build our own primitive apps. |
#80
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
In message , arlen michael holder
writes I'm sorry for you on losing all your work. It happened to me quite a few times, although for different reasons, as I reinstalled my Android Studio and moved directories around, and changed locations of SDKs and JDKs, etc., some of which screwed everything up. It's hard to believe, but there was another MS update last night - they are there in the Update History - and the same thing happened again. This time everything was saved and restarted fine, but one or two other things outside Android Studio seemed to get rearranged. I really do think Microsoft have lost the plot, but here isn't the place to rant. In the future, there are a few ways to prevent that loss of all your work. One, of course, which you found, is AndroidStudio321:File Save All (control+s) Another save method is to export to a zip file: AndroidStudio321:File Export to zip file Later, when we get good at trusting Android Studio, we can use the built-in version-control menu system AndroidStudio321:VCS Import into version control A method I use a lot lately is to right click in Windows file explorer and just zip it up whenever I want to create a checkin point, where there is app08_a.zip, app08_b.zip, app08_c.zip, etc.. This way I can get back to where I last was if/when I screw up. Zipping everything up is probably a good plan. Most of what I mess with on various machines is audio, so I rely on rotating uncompressed backups to a server on the network. As the W10 machine isn't really in the list of serious PC's, it hasn't been getting backed up as much as others. BTW, once I figured out how to port app06 (grocery list) to app08, changing that grocery list to handle any number of items was trivial. These are real items, at my local grocery store, where I took pictures of what I normally buy there (i.e., the best deals). I'm curious how the prices are with respect to yours! I'm afraid I have a wife who does the food shopping - we are looking after someone with very weird dietary tastes - so I haven't checked out or taken photos of any items and prices. I was surprised to see litres in your list, it's a mess over here with litres, pounds, pints, kilograms, feet, metres all mixed up. I just used some random photos I found on the machine. My wife doesn't drive, so I sit outside the stores waiting while she gabs to all her friends. That's when I try to re-grasp Java from my ancient book. So, I've now completed Butterfield 3, and am thinking about what to do next while I try to vaguely understand what I have done. I will watch the 4th video and think about that and whether it as worth going through it as is or thinking of some other way to move on. Moving around the ide is, as you say, getting smoother and somewhat more familiar. I do feel I need to get a grip on Java and more au fait with where to find things asap. -- Bill --- This email has been checked for viruses by AVG. https://www.avg.com |
#81
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
On Sat, 10 Nov 2018 10:43:10 +0000, Bill wrote:
I have now got through the text based button and message build, which works, and am starting on the first Butterfield video. Hi Bill, Heads up! I just finished the last Butterfield video (number 4 of 4). Do NOT do it! It's completely different in character from the previous 3. Don't even _think_ of doing it. Really. I don't think _anyone_ (at our stage) can be successful with it. You need to set up a SQL server which he doesn't cover at all! And he skips steps like you can't believe! He never even scrolls through the final code so you can check for errors. It's just not worth the effort. I wish I knew that before I went through every step, but I know that now. Everything below is simply detail on the information above. Don't do that fourth Butterfield product. Let's find another that's better. ================================================== ========================== o Android Studio For Beginners Part 1, 2, 3, 4 by Bill Butterfield, Published on Jun 13, 2017 https://youtu.be/dFlPARW5IX8 (part 1) a simple adder https://youtu.be/6ow3L39Wxmg (part 2) call a program outside the app https://youtu.be/rdGpT1pIJlw (part 3) grocery list https://youtu.be/bu5Y3uZ6LLM (part 4) mysql grocery list ================================================== ========================== The first three videos are fantastic, but the fourth is almost impossible. o You need to set up an sql server and database on port 3306 o You need to obtain & set up oracle mysql workbench o You need to add .NET Framework & Visual C++ runtimes if you don't have them o His video is mysql version 3 but the current version is version 8 o You need to import the java connector jar file library as a module o He cuts and pastes entire files during the video without scrolling! o That's critical since you can't follow easily what he's doing. This last video is NOTHING like the prior 3 videos in terms of handholding! ================================================== ========================== Some of the software you need will be: ================================================== ========================== JDBC Driver for MySQL (Connector/J) https://dev.mysql.com/downloads/connector/j/ Hit "Platform Independent" in the selector. That gives a tar ball and a zip archive. Obviously get the zip archive. Platform Independent (Architecture Independent), ZIP Archive 8.0.13 6.4M Download (mysql-connector-java-8.0.13.zip) MD5: a106e8c50a616b93ce28a6f7cb991586 https://dev.mysql.com/downloads/file/?id=480292 Begin Your Download mysql-connector-java-8.0.13.zip https://cdn.mysql.com//Downloads/Con...ava-8.0.13.zip ================================================== ========================== Unzip and move the mysql-connector-java-8.0.13 folder to C:\app\editor\android\sql\mysql-connector-java-8.0.13\ Make a note of the path (as you'll need it later): C:\app\editor\android\sql\mysql-connector-java-8.0.13\mysql-connector-java-8.0.13.jar ================================================== ========================== My Sequel Workbench https://dev.mysql.com/downloads/workbench/ Windows (x86, 64-bit), MSI Installer 8.0.13 33.6M Download (mysql-workbench-community-8.0.13-winx64.msi) MD5: 298f374a2a032bf5148fc4909a2dcab1 | Signature https://dev.mysql.com/downloads/file/?id=480542 https://cdn.mysql.com//Downloads/MyS....13-winx64.msi Requires: o Microsoft .NET Framework 4.5 https://www.microsoft.com/en-us/down....aspx?id=30653 https://download.microsoft.com/downl...Full_setup.exe o Visual C++ Redistributable for Visual Studio 2015 https://www.microsoft.com/en-us/down....aspx?id=48145 https://download.microsoft.com/downl...redist.x64.exe https://download.microsoft.com/downl...redist.x86.exe ================================================== ========================== Importing the jar file is pretty easy though: AndroidStudio321: Right click on app new module import JAR/.AAR Package C:\app\editor\android\sql\mysql-connector-java-8.0.13\mysql-connector-java-8.0.13.jar ================================================== ========================== Even if you get the program to work, you _still_ need to set up a SQL server! ================================================== ========================== Here are the main files at the point that I gave up (after about 2 hours). o C:\tmp\android\app07\app\src\main\AndroidManifest. xml o C:\tmp\android\app07\app\src\main\java\com\kiss\ap p07\mainActivity.java o C:\tmp\android\app07\app\src\main\java\com\kiss\ap p07\ItemAdapter.java o C:\tmp\android\app07\app\src\main\java\com\kiss\ap p07\DbStrings.java o C:\tmp\android\app07\app\build.gradle o C:\tmp\android\app07\app\src\main\res\layout\item_ layout.xml o C:\tmp\android\app07\app\src\main\res\layout\activ ity_main.xml ================================================== ========================== C:\tmp\android\app07\app\src\main\AndroidManifest. xml ?xml version="1.0" encoding="utf-8"? manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.kiss.app07" uses-permission android:name="android.permission.INTERNET" / application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" activity android:name=".MainActivity" intent-filter action android:name="android.intent.action.MAIN" / category android:name="android.intent.category.LAUNCHER" / /intent-filter /activity /application /manifest ================================================== ========================== C:\tmp\android\app07\app\src\main\java\com\kiss\ap p07\mainActivity.java package com.kiss.app07; import android.content.Context; import android.content.res.Resources; import android.os.AsyncTask; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ListView; import android.widget.TextClock; import android.widget.TextView; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.LinkedHashMap; import java.util.Map; public class MainActivity extends AppCompatActivity { ItemAdapter itemAdapter; Context thisContext; ListView myListView; TextView progressTextView; MapString, Double fruitsMap = new LinkedHashMapString, Double(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Resources res = getResources(); myListView = (ListView) findViewById(R.id.myListView); progressTextView = (TextView) findViewById(R.id.progressTextView); thisContext = this; progressTextView.setText(""); Button btn = (Button) findViewById(R.id.getDataButton); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { GetData retrieveData = new GetData(); retrieveData.execute(""); } }); } }; } private class GetData extends AsyncTaskString, String, String { String msg = ""; // JDBC drivr name and database URL static final String JDBC_DRIVER = "com.kill.app07.Driver"; // Example: 10.20.30.40:3306 static final String DB_URL = "jdbc:mysql://" + DbStrings.DATABASE_URL + "/" + DbStrings.DATABASE_NAME; @Override protected void onPreExecute() { progressTextView.setText("Connecting to database..."); } @Override protected String doInBackground(String...params) { Connection conn = null; Statement stmt = null; try { Class.forName(JDBC_DRIVER); conn = DriverManager.getConnection(DB_URL, DbStrings.USERNAME, DbStrings.PASSWORD); stmt = conn.createStatement(); String sql = "SELECT * FROM fruits"; ResultSet rs = stmt.executeQuery(sql); while (rs.next()) { String name = rs.getString("name"); double price = rs.getDouble("price"); fruitsMap.put(name, price); } msg = "Process complete."; rs.close(); stmt.close(); conn.close(); } catch (SQLException connError) { msg = "An exception was thorn for JDBC."; connError.printStackTrace(); ; } catch (ClassNotFoundException e) { msg = "A class not found exception was thrown."; e.printStackTrace(); } finally { try { if (stmt != null) { stmt.close(); } } catch (SQLException e) { e.printStackTrace(); } try { if (conn != null) { conn.close(); } } catch (SQLException e) { e.printStackTrace(); } } return null; } @Override protected void onPostExexute (String msg){ progressTextView.setText(this.msg); if (fruitsMap.size() 0) { itemAdapter = new ItemAdapter(thisContext, fruitsMap); myListView.setAdapter(itemAdapter); } } } //End of MainActivity ================================================== ========================== C:\tmp\android\app07\app\src\main\java\com\kiss\ap p07\ItemAdapter.java package com.kiss.app07; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import com.kiss.app07.R; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * Created by Example on 11/15/2018. */ public class ItemAdapter extends BaseAdapter { LayoutInflater mInflator; MapString, Double map; ListString names; ListDouble prices; public ItemAdapter(Context c, Map m) { mInflator = (LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE ); map = m; names = new ArrayListString(map.keySet()); prices = new ArrayListDouble(map.values()); } @Override public int getCount() { return map.size(); } @Override public Object getItem(int i) { return names.get(i); } @Override public long getItemId(int i) { return i; } @Override public View getView(int i, View convertView, ViewGroup parent) { View v = mInflator.inflate(R.layout.item_layout, null); TextView nameTextView = (TextView) v.findViewById(R.id.nameTextView); TextView priceTextView = (TextView) v.findViewById(R.id.priceTextView); nameTextView.setText(names.get(i)); priceTextView.setText("$" + prices.get(i).toString()); return v; } } ================================================== ========================== C:\tmp\android\app07\app\src\main\java\com\kiss\ap p07\DbStrings.java package com.kiss.app07; public class DbStrings { static final String DATABASE_URL = "129.0.0.1:3306"; static final String DATABASE_NAME = "mhs_example"; static final String USERNAME = "some_user"; static final String PASSWORD = "your_password"; } ================================================== ========================== C:\tmp\android\app07\app\build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.kiss.app07" minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunne r" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-co3.0.2' compile project (':mysql-connector-java-8.0.13') } ================================================== ========================== C:\tmp\android\app07\app\src\main\res\layout\item_ layout.xml ?xml version="1.0" encoding="utf-8"? RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" TextView android:id="@+id/nameTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:layout_marginStart="24dp" android:layout_marginTop="35dp" android:layout_marginBottom="35dp" android:text="Name" / TextView android:id="@+id/priceTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/nameTextView" android:layout_alignParentEnd="true" android:layout_marginEnd="63dp" android:text="Price" / /RelativeLayout ================================================== ========================== C:\tmp\android\app07\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/getDataButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:layout_marginEnd="8dp" android:text="Get Data" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" / TextView android:id="@+id/progressTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:text="Progress" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/getDataButton" / ListView android:id="@+id/myListView" android:layout_width="368dp" android:layout_height="412dp" android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" / /android.support.constraint.ConstraintLayout ================================================== ========================== ================================================== ========================== |
#82
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
On Sat, 10 Nov 2018 10:43:10 +0000, Bill wrote:
I have now got through the text based button and message build, which works, and am starting on the first Butterfield video. Hi Bill, Heads up! I just finished the last Butterfield video (number 4 of 4). Do NOT do it! It's completely different in character from the previous 3. Don't even _think_ of doing it. Really. I don't think _anyone_ (at our stage) can be successful with it. You need to set up a SQL server which he doesn't cover at all! And he skips steps like you can't believe! He never even scrolls through the final code so you can check for errors. It's just not worth the effort. I wish I knew that before I went through every step, but I know that now. Everything below is simply detail on the information above. Don't do that fourth Butterfield product. Let's find another that's better. ================================================== ========================== o Android Studio For Beginners Part 1, 2, 3, 4 by Bill Butterfield, Published on Jun 13, 2017 https://youtu.be/dFlPARW5IX8 (part 1) a simple adder https://youtu.be/6ow3L39Wxmg (part 2) call a program outside the app https://youtu.be/rdGpT1pIJlw (part 3) grocery list https://youtu.be/bu5Y3uZ6LLM (part 4) mysql grocery list ================================================== ========================== The first three videos are fantastic, but the fourth is almost impossible. o You need to set up an sql server and database on port 3306 o You need to obtain & set up oracle mysql workbench o You need to add .NET Framework & Visual C++ runtimes if you don't have them o His video is mysql version 3 but the current version is version 8 o You need to import the java connector jar file library as a module o He cuts and pastes entire files during the video without scrolling! o That's critical since you can't follow easily what he's doing. This last video is NOTHING like the prior 3 videos in terms of handholding! ================================================== ========================== Some of the software you need will be: ================================================== ========================== JDBC Driver for MySQL (Connector/J) https://dev.mysql.com/downloads/connector/j/ Hit "Platform Independent" in the selector. That gives a tar ball and a zip archive. Obviously get the zip archive. Platform Independent (Architecture Independent), ZIP Archive 8.0.13 6.4M Download (mysql-connector-java-8.0.13.zip) MD5: a106e8c50a616b93ce28a6f7cb991586 https://dev.mysql.com/downloads/file/?id=480292 Begin Your Download mysql-connector-java-8.0.13.zip https://cdn.mysql.com//Downloads/Con...ava-8.0.13.zip ================================================== ========================== Unzip and move the mysql-connector-java-8.0.13 folder to C:\app\editor\android\sql\mysql-connector-java-8.0.13\ Make a note of the path (as you'll need it later): C:\app\editor\android\sql\mysql-connector-java-8.0.13\mysql-connector-java-8.0.13.jar ================================================== ========================== My Sequel Workbench https://dev.mysql.com/downloads/workbench/ Windows (x86, 64-bit), MSI Installer 8.0.13 33.6M Download (mysql-workbench-community-8.0.13-winx64.msi) MD5: 298f374a2a032bf5148fc4909a2dcab1 | Signature https://dev.mysql.com/downloads/file/?id=480542 https://cdn.mysql.com//Downloads/MyS....13-winx64.msi Requires: o Microsoft .NET Framework 4.5 https://www.microsoft.com/en-us/down....aspx?id=30653 https://download.microsoft.com/downl...Full_setup.exe o Visual C++ Redistributable for Visual Studio 2015 https://www.microsoft.com/en-us/down....aspx?id=48145 https://download.microsoft.com/downl...redist.x64.exe https://download.microsoft.com/downl...redist.x86.exe ================================================== ========================== Importing the jar file is pretty easy though: AndroidStudio321: Right click on app new module import JAR/.AAR Package C:\app\editor\android\sql\mysql-connector-java-8.0.13\mysql-connector-java-8.0.13.jar ================================================== ========================== Even if you get the program to work, you _still_ need to set up a SQL server! ================================================== ========================== Here are the main files at the point that I gave up (after about 2 hours). o C:\tmp\android\app07\app\src\main\AndroidManifest. xml o C:\tmp\android\app07\app\src\main\java\com\kiss\ap p07\mainActivity.java o C:\tmp\android\app07\app\src\main\java\com\kiss\ap p07\ItemAdapter.java o C:\tmp\android\app07\app\src\main\java\com\kiss\ap p07\DbStrings.java o C:\tmp\android\app07\app\build.gradle o C:\tmp\android\app07\app\src\main\res\layout\item_ layout.xml o C:\tmp\android\app07\app\src\main\res\layout\activ ity_main.xml ================================================== ========================== C:\tmp\android\app07\app\src\main\AndroidManifest. xml ?xml version="1.0" encoding="utf-8"? manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.kiss.app07" uses-permission android:name="android.permission.INTERNET" / application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" activity android:name=".MainActivity" intent-filter action android:name="android.intent.action.MAIN" / category android:name="android.intent.category.LAUNCHER" / /intent-filter /activity /application /manifest ================================================== ========================== C:\tmp\android\app07\app\src\main\java\com\kiss\ap p07\mainActivity.java package com.kiss.app07; import android.content.Context; import android.content.res.Resources; import android.os.AsyncTask; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ListView; import android.widget.TextClock; import android.widget.TextView; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.LinkedHashMap; import java.util.Map; public class MainActivity extends AppCompatActivity { ItemAdapter itemAdapter; Context thisContext; ListView myListView; TextView progressTextView; MapString, Double fruitsMap = new LinkedHashMapString, Double(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Resources res = getResources(); myListView = (ListView) findViewById(R.id.myListView); progressTextView = (TextView) findViewById(R.id.progressTextView); thisContext = this; progressTextView.setText(""); Button btn = (Button) findViewById(R.id.getDataButton); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { GetData retrieveData = new GetData(); retrieveData.execute(""); } }); } }; } private class GetData extends AsyncTaskString, String, String { String msg = ""; // JDBC drivr name and database URL static final String JDBC_DRIVER = "com.kill.app07.Driver"; // Example: 10.20.30.40:3306 static final String DB_URL = "jdbc:mysql://" + DbStrings.DATABASE_URL + "/" + DbStrings.DATABASE_NAME; @Override protected void onPreExecute() { progressTextView.setText("Connecting to database..."); } @Override protected String doInBackground(String...params) { Connection conn = null; Statement stmt = null; try { Class.forName(JDBC_DRIVER); conn = DriverManager.getConnection(DB_URL, DbStrings.USERNAME, DbStrings.PASSWORD); stmt = conn.createStatement(); String sql = "SELECT * FROM fruits"; ResultSet rs = stmt.executeQuery(sql); while (rs.next()) { String name = rs.getString("name"); double price = rs.getDouble("price"); fruitsMap.put(name, price); } msg = "Process complete."; rs.close(); stmt.close(); conn.close(); } catch (SQLException connError) { msg = "An exception was thorn for JDBC."; connError.printStackTrace(); ; } catch (ClassNotFoundException e) { msg = "A class not found exception was thrown."; e.printStackTrace(); } finally { try { if (stmt != null) { stmt.close(); } } catch (SQLException e) { e.printStackTrace(); } try { if (conn != null) { conn.close(); } } catch (SQLException e) { e.printStackTrace(); } } return null; } @Override protected void onPostExexute (String msg){ progressTextView.setText(this.msg); if (fruitsMap.size() 0) { itemAdapter = new ItemAdapter(thisContext, fruitsMap); myListView.setAdapter(itemAdapter); } } } //End of MainActivity ================================================== ========================== C:\tmp\android\app07\app\src\main\java\com\kiss\ap p07\ItemAdapter.java package com.kiss.app07; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import com.kiss.app07.R; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * Created by Example on 11/15/2018. */ public class ItemAdapter extends BaseAdapter { LayoutInflater mInflator; MapString, Double map; ListString names; ListDouble prices; public ItemAdapter(Context c, Map m) { mInflator = (LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE ); map = m; names = new ArrayListString(map.keySet()); prices = new ArrayListDouble(map.values()); } @Override public int getCount() { return map.size(); } @Override public Object getItem(int i) { return names.get(i); } @Override public long getItemId(int i) { return i; } @Override public View getView(int i, View convertView, ViewGroup parent) { View v = mInflator.inflate(R.layout.item_layout, null); TextView nameTextView = (TextView) v.findViewById(R.id.nameTextView); TextView priceTextView = (TextView) v.findViewById(R.id.priceTextView); nameTextView.setText(names.get(i)); priceTextView.setText("$" + prices.get(i).toString()); return v; } } ================================================== ========================== C:\tmp\android\app07\app\src\main\java\com\kiss\ap p07\DbStrings.java package com.kiss.app07; public class DbStrings { static final String DATABASE_URL = "129.0.0.1:3306"; static final String DATABASE_NAME = "mhs_example"; static final String USERNAME = "some_user"; static final String PASSWORD = "your_password"; } ================================================== ========================== C:\tmp\android\app07\app\build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.kiss.app07" minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunne r" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-co3.0.2' compile project (':mysql-connector-java-8.0.13') } ================================================== ========================== C:\tmp\android\app07\app\src\main\res\layout\item_ layout.xml ?xml version="1.0" encoding="utf-8"? RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" TextView android:id="@+id/nameTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:layout_marginStart="24dp" android:layout_marginTop="35dp" android:layout_marginBottom="35dp" android:text="Name" / TextView android:id="@+id/priceTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/nameTextView" android:layout_alignParentEnd="true" android:layout_marginEnd="63dp" android:text="Price" / /RelativeLayout ================================================== ========================== C:\tmp\android\app07\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/getDataButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:layout_marginEnd="8dp" android:text="Get Data" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" / TextView android:id="@+id/progressTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:text="Progress" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/getDataButton" / ListView android:id="@+id/myListView" android:layout_width="368dp" android:layout_height="412dp" android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" / /android.support.constraint.ConstraintLayout ================================================== ========================== ================================================== ========================== |
#83
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
In message , arlen michael holder
writes Everything below is simply detail on the information above. Don't do that fourth Butterfield product. Let's find another that's better. ================================================= ======================= ==== o Android Studio For Beginners Part 1, 2, 3, 4 by Bill Butterfield, Published on Jun 13, 2017 https://youtu.be/dFlPARW5IX8 (part 1) a simple adder https://youtu.be/6ow3L39Wxmg (part 2) call a program outside the app https://youtu.be/rdGpT1pIJlw (part 3) grocery list https://youtu.be/bu5Y3uZ6LLM (part 4) mysql grocery list ================================================= ======================= ==== The first three videos are fantastic, but the fourth is almost impossible. o You need to set up an sql server and database on port 3306 o You need to obtain & set up oracle mysql workbench o You need to add .NET Framework & Visual C++ runtimes if you don't have them o His video is mysql version 3 but the current version is version 8 o You need to import the java connector jar file library as a module o He cuts and pastes entire files during the video without scrolling! o That's critical since you can't follow easily what he's doing. This last video is NOTHING like the prior 3 videos in terms of handholding! The situation at my end is that I still haven't had time to watch through that 4th video, but I do still plan to at least do that before moving on. I've used simple database software for years and ended up ages ago settling on mySQL as the one I always use. I have a bunch of mySQL databases here. I have used Workbench and ODBC in the past, but not JDBC. Like everything else, I've forgotten how I set them up, but for the last few years have just used them. So, the plan is to look at the 4th video and see what I think. For the record, I think your alarm would be a good starting point if we can't find a good next step video or mini-course. My personal app that I would like to have a shot at if I get more confident is a very simple camera app with very few frills. Stage 1: Opening screen with big buttons to select: 1. Single picture every 5 secs or continuous video 2. Light on or off 3. Front or back camera. 4. Go! Having hit Go!, huge button or whole screen tap, toggles picture sequence or video. Stage 2 Same interface, but uses external "snake" type camera to poke into things The idea is to make something that is easy to use in awkward situations, and was prompted by my efforts to inspect hidden engine areas on a European-built Jeep Grand Cherokee with Merc engine of black-death fame (now thankfully sold) and inspect the insides of various stringed musical instruments like guitars, mandolins etc. This is probably way beyond me, but we'll see. -- Bill --- This email has been checked for viruses by AVG. https://www.avg.com |
#84
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
On Fri, 16 Nov 2018 00:19:17 +0000, Bill wrote:
It's hard to believe, but there was another MS update last night Oh my... I'm sorry for you... that update is a killer sometimes. I have a relatively recent thread on the Windows 10 ng on how to _prevent_ all MS updates from happening. I was successful at preventing updates for _years_, for example, until the Microsoft update around the late January time frame _bricked_ my system. It's a loooooooong well documented saga, where I even resorted to taking the desktop to the huge Microsoft Store (right across from the huge Apple Store in the local San Jose Valley Fair shopping mall) - and after two or three days - they declared that they couldn't unbrick it either. Sigh. At that point, I gave up on stopping Microsoft updates.... but then ... a month or two later ... I tried to completely remove Cortana (and not just to redirect it to a dead browser)... which I was successful at actually ... until the next Microsoft Update, which, ... guess what ... bricked my system again. Again the Microsoft Store couldn't unbrick it. Guess what I do now? (HINT: My Windows is 100% up to date, & it has that stupid Cortana.) Zipping everything up is probably a good plan. Yep. In Windows, you can sequentially zip to app07_a.zip, app07_b.zip, app07_c.zip, etc., and you always have a convenient "restore" point. You can even zip to video tutorial time points, e.g., tutorial07_time15:45.zip, tutorial07_time20:30.zip, etc. I'm not sure if you need to "Close" the Android project and to kill Android Studio, but just in case there are files in a semi-accessible state (e.g., those in virtual memory?), I generally do the following before zipping: 1. AndroidStudio321:File Save All 2. AndroidStudio321:File Close Project 3. (I "x" out the project in the "Welcome Screen" that results) 4. AndroidStudio321:File Exit I was surprised to see litres in your list, it's a mess over here with litres, pounds, pints, kilograms, feet, metres all mixed up. Yup. Standard USA tire sizes, for example, are in inches (for the diameter), millimeters (for the width), and percentages (for the height), where I'm not sure how folks across the pond do tire sizes. While everyone in the USA has duplicate sets of Imperial and Metric wrenches, you UK folks have additional UK-specific sizes. Most (if not all) of our liquids, solids, and gases (are there gases?) in the grocery store, are in both Imperial and Metric quantities. It's just our roads that are exclusively in Imperial units. They went to metric before OPEC got mad at us in the 70s, but we pulled down all the duplicated kilometer signs soon thereafter (in protest?). While tools and groceries are dual-Imperial/Metric, I haven't seen a kilometer road sign since the 70s. My wife doesn't drive, so I sit outside the stores waiting while she gabs to all her friends. That's when I try to re-grasp Java from my ancient book. Out here, everyone drives. You can't survive without driving. We haven't even invented a school bus in California. Nor mass transit that actually goes anywhere you need to go. I live in mountains above Silicon Valley where the roads are single lane for miles and miles and miles. We're so far from anything that I stock my own gasoline, for example, where I always keep 50 gallons on hand for refueling (since the nearest gas station is a 30 mile round trip). Likewise with groceries. We stock fifty-pound bags of sugar and flour and rice from Costco. Unfortunately, pasta only comes in puny six-pound packs but olive oil, conveniently, comes in four-liter and one-liter packages. I think it would be fun to write a Costco-specific grocery app, since Costco has good prices on large quantities ... where they don't allow picture taking but I do it anyway (and where I write on the labels in pencil the price per unit since they conveniently are haphazard about that). One app that would be nice is a grocery store price comparison app. I covered them in gory detail in 2014, but I haven't visited them since. Comparing prices for grocery shopping using Android free app (9/19/2014) https://groups.google.com/d/msg/comp.mobile.android/OlycIR5kIp8/cNmdPt0wD0MJ The trick is populating a price database for each store where shopping comparisons for just the items you care about can be compared at home. So, I've now completed Butterfield 3, and am thinking about what to do next while I try to vaguely understand what I have done. I will watch the 4th video and think about that and whether it as worth going through it as is or thinking of some other way to move on. **Kudos to you for completing Butterfield 3!** I hope my text posts helped. If not, let me know as it's a LOT of work to post that stuff. (I post it to be helpful - but if it's not helpful - then I can save the effort and spend it on learning more instead of posting more.) BTW, moving forward, here are the short "timer" videos I'm evaluating... *Android alarm clock tutorial, by Anna Xu, published Jan 18, 2016* o Part 1: Demo and user interface https://youtu.be/xbBlzOblD10 o Part 2: Initializing UI https://youtu.be/XIPSCe-38fM o Part 3: The onClickListener https://youtu.be/KseXIsTLXaY o Part 4: Alarm Manager https://youtu.be/R3AzhgzbpTc o Part 5: Ringtone Service I https://youtu.be/GlLafRXJmGA o Part 6: Ringtone Service II https://youtu.be/UDVfJzWpuWc o Part 7: Ringtone Service III https://youtu.be/UCYv-TfKRMw o Part 8: Notifications https://youtu.be/mgp7qjTXW2o o Part 9: Spinner I https://youtu.be/eNZwsPEgVQI o Part 10: Spinner II https://youtu.be/eNZwsPEgVQI o Part 11: Spinner III https://youtu.be/TyFmKvvt3Zs Now that I gave up on the SQL endeavor (for now), today I downloaded that set of Anna Xu videos to start the evaluation on the first one. I'll report back when/if I have something of value to report (as I'm all about "adding value" in every post, if possible). Moving around the ide is, as you say, getting smoother and somewhat more familiar. I do feel I need to get a grip on Java and more au fait with where to find things asap. I agree on both points. The IDE is happening as we inevitably get more comfortable with the IDE. The java comprehension will happen as we inevitably need to debug errors. |
#85
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
On Fri, 16 Nov 2018 18:52:27 -0000 (UTC), arlen michael holder wrote:
As an aside, it's always the people who have never done such things who blithely proclaim all sorts of "googled solutions", which, is kind of funny in that the less someone knows of the problem, the more so-called "solutions" they can find on the net. BTW, since I do all my own mechanical work, that means I do my own suspension alignment (you know, camber, caster, & toe, X, Y, & Zed). The measurement of X, Y, and Zee aren't difficult using cellphones, which have the required accuracy for angles, and the adjustment of the bolts is trivial, where toe plates and camber jigs help. What's difficult s the MATH involved. It makes your head explode. Not because trig is difficult mind you, as trig is trivial. Only someone who has done their own alignment would understand why I say the math makes your head explode - which is where a cellphone app could play a key role in simplifying things. You see, what you measure at home for an alignment is NEVER what the spec actually is. Why? I can't tell you why. I can just tell you that it is. For example, my bimmer has toe spec'd in degrees, but, at home, you typically measure toe in inches, not in degrees ... simply because it's trivial to measure toe in inches at home to the desired accuracy. Yet, most American cars (thankfully) spec toe in inches (which, for once, makes sense), but of course, it's often inches to centerline, where you then have to figure out what they define as the centerline (which can be different on every vehicle). For camber, at least you get a spec in degrees, but you can measure camber in inches using just a plumb bob and a ruler, so again, you have to convert (using basic trig) from inches to degrees. Meanwhile, you compute caster from other measurements. The point is that (a) each vehicle is different in how it differs from (a) the specs it gives you, and (b) the specs you can easily measure at home. All the work is NOT in the measurements (measuring camber and toe to the required precision and repeatability is trivial for example) nor is there any work in the adjustments (twisting a bolt is easy, and even easier to replicate the normal position of the vehicle with niceties like toe plates and camber jigs). All the work is in the math. That's where an app that measures angles and which can take as input inches, can be a wonderful app that, to my knowledge, doesn't exist yet. Does anyone here know of such an app for example? |
#86
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
In message , arlen michael holder
writes Auuuuuurrrrrrrrrgggggggggmmmmmmmmmhhhhhh! I hate that selfie button. I've never wanted it once in my entire life. In my kiss camera app, it won't exist! Just a very quick follow up on this point. I thought that switch useful for occasions when one might poke the camera into some area and yet be able to see part of the screen to aim the image better up and under. One of the Android 4 phones I have kept is still here because it has just one hinged camera at the top. It can revolve through 180 degrees to point front or back, straight up or anywhere in between. It has been extremely useful, but I've never seen another phone like it. It's branded "Timmy" and was extremely low cost, something like the equivalent of $35 when I bought it new.. I had to be up this morning at 4.45 to drive daughter to a railway station, and had no time to watch the No 4 video until late afternoon. I saw about half, then went to sleep! So nothing achieved today. -- Bill --- This email has been checked for viruses by AVG. https://www.avg.com |
#87
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
In message , arlen michael holder
writes **Kudos to you for completing Butterfield 3!** I hope my text posts helped. If not, let me know as it's a LOT of work to post that stuff. (I post it to be helpful - but if it's not helpful - then I can save the effort and spend it on learning more instead of posting more.) BTW, moving forward, here are the short "timer" videos I'm evaluating... *Android alarm clock tutorial, by Anna Xu, published Jan 18, 2016* o Part 1: Demo and user interface https://youtu.be/xbBlzOblD10 o Part 2: Initializing UI https://youtu.be/XIPSCe-38fM o Part 3: The onClickListener https://youtu.be/KseXIsTLXaY o Part 4: Alarm Manager https://youtu.be/R3AzhgzbpTc o Part 5: Ringtone Service I https://youtu.be/GlLafRXJmGA o Part 6: Ringtone Service II https://youtu.be/UDVfJzWpuWc o Part 7: Ringtone Service III https://youtu.be/UCYv-TfKRMw o Part 8: Notifications https://youtu.be/mgp7qjTXW2o o Part 9: Spinner I https://youtu.be/eNZwsPEgVQI o Part 10: Spinner II https://youtu.be/eNZwsPEgVQI o Part 11: Spinner III https://youtu.be/TyFmKvvt3Zs Now that I gave up on the SQL endeavor (for now), today I downloaded that set of Anna Xu videos to start the evaluation on the first one. I'll report back when/if I have something of value to report (as I'm all about "adding value" in every post, if possible). With all this, you are racing ahead of me. I'm now just into the beginning of Butterfield 4, having decided to set up mySQL from scratch on the W10 machine to keep everything away from the working databases on the main machines. All your work listing all the files has been really helpful to me, so do carry on if possible. The debugging problems I've had have mainly been stupid things like additional or missing spaces in the middle of code or problems with the case of characters. I seem to be almost blind to these. You are obviously more organised than I'll ever be. The lists of videos as above are also really useful, but again, I'm finding it hard to keep up. I may not keep up, but I don't usually give up. -- Bill --- This email has been checked for viruses by AVG. https://www.avg.com |
#88
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
On Sat, 17 Nov 2018 15:37:21 +0000, Bill wrote:
With all this, you are racing ahead of me. Nope. It's not a race. It's just two people helping each other, and, at the same time, giving encouragement to ANYONE who wants to try to write Android apps from their desktop. I'm now just into the beginning of Butterfield 4, having decided to set up mySQL from scratch on the W10 machine to keep everything away from the working databases on the main machines. Hi Bill, This is GREAT. I gave up on even _thinking_ about setting up my own mySQL server (remember, I can't even pronounce it, let alone understand it). So I will get back to Butterfield #4 only after you've been successful (so I can stand on your shoulders). I replaced my placeholder "app07" with a Kotlin-based app for randomizing http://www.bild.me/bild.php?file=8019905androidstudio85.jpg Where the tutorial I used was the _best_ (bar none!) of _all_ we've seen! https://youtu.be/EOfCEhWq8sg Then I painstakingly converted it from Kotlin to Java, which took me multiple tries, as, well, as you know ... everything about copying Android projects on the net is either wrong or incomplete ... and then there's the kotlin stuff to add to it (e.g., MainActivity.kt -- MainActivity.java) but I wrote that all up (and posted it in this thread) to give back to Usenet for what I found on the net. https://groups.google.com/d/msg/comp.mobile.android/aW64zYeBtF0/7scIwbp5AAAJ All your work listing all the files has been really helpful to me, so do carry on if possible. Hi Bill, That's good as it's a _lot_ of effort to post the files (and all the pictures and references takes a tone of effort also). I do that extra effort to _help_ people ... so I'm glad it helped you! (It's why I come down hard on those who have only "imaginary" solutions.) The debugging problems I've had have mainly been stupid things like additional or missing spaces in the middle of code or problems with the case of characters. I seem to be almost blind to these. You are obviously more organised than I'll ever be. I'm "organized" but I made a ton of mistakes. Always remember that the DIY always is an "ideal" case. All the missed steps, the accidentally removed files, the typos, the wrong buttons, etc., are conveniently absent from the DIY. For example, this is the Kotlin-to-Java DIY I painstakingly figured out: https://groups.google.com/d/msg/comp...0/7scIwbp5AAAJ It looks simple, right? It looks so easy, right? But it took multiple tries to figure out all the steps. For example, it failed before I closed and then reopened Android Studio? Why? I don't know why. But that's why I inserted the step to close & then re-open Android Studio. All tutorials are an "idealized" version of the real path! The lists of videos as above are also really useful, but again, I'm finding it hard to keep up. I may not keep up, but I don't usually give up. *HEADS UP BILL!* *Do NOT do the Anna Xu tutorials!* It's too bad, as she's WONDERFULLY clear about all her steps. She goes SLOWLY (perfectly slowly) in explaining things. She's fantastic. But. But but but ... dammit ... but... Anna Xu is using Android Studio 1.5.1 on Windows. Drat. We're on version 3.2.1, which is EXTREMELY different! For example, Anna Xu adds a "container" "time picker", which seems simple enough, but that _entire_ time-picker GUI doesn't exist on our version of the IDE. It exists _only_ in code, apparently: o https://developer.android.com/guide/...ntrols/pickers So, even at the _start_ of those Anna Xu videos, nothing is even close to what we're doing. I don't know if when we're much better at this than we are now, that we can follow (probably we can), but, for now, I have to ditch those otherwise fantastic-seeming series of more than a dozen Anna Xu tutorials on creating alarm clock apps. Sigh. PS: I have to write a novel for nanowrimo, so I am splitting my time. |
#89
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
In message , arlen michael holder
writes PS: I have to write a novel for nanowrimo, so I am splitting my time. I hope that goes well and you devote a lot of time to it, as I'm very conscious of slipping back. :-) I've now got Butterfield 4 up and running to the point where it displays a "Class not found exception" on the virtual phone. This appears to be due to the connector, so I'm going to have to dig into that. So there will now be a delay, unless I have a breakthrough in the next few minutes, while I spend some time back in real life. I see what you mean about his copying blocks of text in, making it much more difficult to follow. I suppose course notes are too much to expect on free guidance like this. I'll report back any progress. -- Bill --- This email has been checked for viruses by AVG. https://www.avg.com |
#90
|
|||
|
|||
Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)
On Sun, 18 Nov 2018 20:14:38 +0000, Bill wrote:
I'll report back any progress. Hi Bill, You made great progress, as you have the SQL server, which Bill Butterfield simply waved a hand assuming it was already made in that video #4. I'm glad, in a way, that you concur with my observations where he just pastes entire files, without going over them line by line, where it took me at least an hour just to piece it all together. I hope it helped. I tried an experiment today, which failed, but which I will let you know about so that you can learn from my many noob mistakes. Actually, this experiment might work *for you* because you can use the Google Emulators, which probably go up to Android 8 (Oreo). Bill - do the Google emulators go up to Android 8 for you? Anyway, these are the facts as I understand them: a. The Google emulators don't work for me (on older AMD Windows CPUs) b. The Microsoft emulator works GREAT, but it stops at Android 6.0 c. The Andyroid emulator works GREAT, but it stops at Android 7.1 The reason I need Android 8 (Oreo), is I tried this tutorial below, but I didn't realize that getting Android 8 running on my older AMD CPU was going to be so difficult! The tutorial below essentially creates a rudimentary "youtube" app. ================================================== ========================== app10 This is a rudimentary youtube app ================================================== ========================== You'll need to run the "Component Installer" ahead of time in Android Studio: Packages to install: Android SDK Platform 27 (platforms;android-27) ================================================== ========================== New Project: app10 Company domain: kiss.com Minimum SDK: API 27: Android 8.1 (Oreo) ================================================== ========================== Activity: Empty Activity Activity Name: MainActivity Layout Name: activity_main ================================================== ========================== File Settings Editor General Auto Import Change from: [_]Add unambiguous imports on the fly [_]Optimize imports on the fly (for current project) Change to: [x]Add unambiguous imports on the fly [x]Optimize imports on the fly (for current project) ================================================== ========================== Expand the following to ensure they exist & that you can find them: app|manifests|AndroidManifest.xml app|java|com.kiss.app10|MainActivity.java app|res|layout|activity_main.xml app|GradleScripts|build.gradle(Module: app) Note: There are two "build.gradle" files (both of the same name)! ================================================== ========================== Modify the file: app|GradleScripts|build.gradle(Module: app) ================================================== ========================== apply plugin: 'com.android.application' android { compileSdkVersion 27 defaultConfig { applicationId "comp.app.kiss.app10" minSdkVersion 27 targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunne r" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:recyclerview-v7:27.1.1' implementation 'com.android.support:cardview-v7:27.1.1' implementation 'com.android.support.constraint:constraint-layout:1.1.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-co3.0.1' } ================================================== ========================== Control+AControl+VControl+S ================================================== ========================== Modify the file app|manifests|AndroidManifest.xml ================================================== ========================== ?xml version="1.0" encoding="utf-8"? manifest xmlns:android="http://schemas.android.com/apk/res/android" package="comp.app.kiss.app10" android:installLocation="preferExternal" uses-permission android:name="android.permission.WRITE_EXTERNAL_ST ORAGE"/ uses-permission android:name="android.permission.ACCESS_NETWORK_ST ATE" / uses-permission android:name="android.permission.ACCESS_WIFI_STATE " / uses-permission android:name="android.permission.INTERNET" / application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" activity android:name=".MainActivity" intent-filter action android:name="android.intent.action.MAIN" / category android:name="android.intent.category.LAUNCHER" / /intent-filter /activity /application /manifest ================================================== ========================== Control+AControl+VControl+S ================================================== ========================== Modify the file: app|res|layout|activity_main.xml ================================================== ========================== ?xml version="1.0" encoding="utf-8"? LinearLayout 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" android.support.v7.widget.RecyclerView android:id="@+id/recyclerView" android:layout_width="match_parent" android:layout_height="match_parent" /android.support.v7.widget.RecyclerView /LinearLayout ================================================== ========================== Control+AControl+VControl+S ================================================== ========================== Rightclick app|res|layout New Layout resource file File name: video_view.xml ================================================== ========================== ?xml version="1.0" encoding="utf-8"? android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="180dp" WebView android:id="@+id/videoWebView" android:layout_width="match_parent" android:layout_height="180dp" /WebView /android.support.constraint.ConstraintLayout ================================================== ========================== Control+AControl+VControl+S ================================================== ========================== Rightclick app|java New Java Class Name: YouTubeVideos Note the lack of an extension (i.e., it's not "YouTubeVideos.java"). ================================================== ========================== public class YouTubeVideos { String videoUrl; public YouTubeVideos() { } public YouTubeVideos(String videoUrl) { this.videoUrl = videoUrl; } public String getVideoUrl() { return videoUrl; } public void setVideoUrl(String videoUrl) { this.videoUrl = videoUrl; } } ================================================== ========================== Control+AControl+VControl+S ================================================== ========================== Rightclick app|java New Java Class Name: VideoAdapter Note the lack of an extension (i.e., it's not "VideoAdapter.java"). ================================================== ========================== import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.webkit.WebChromeClient; import android.webkit.WebView; import java.util.List; public class VideoAdapter extends RecyclerView.AdapterVideoAdapter.VideoViewHolder { ListYouTubeVideos youtubeVideoList; public VideoAdapter() { } public VideoAdapter(ListYouTubeVideos youtubeVideoList) { this.youtubeVideoList = youtubeVideoList; } @Override public VideoViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from( parent.getContext()).inflate(R.layout.video_view, parent, false); return new VideoViewHolder(view); } @Override public void onBindViewHolder(VideoViewHolder holder, int position) { holder.videoWeb.loadData( youtubeVideoList.get(position).getVideoUrl(), "text/html" , "utf-8" ); } @Override public int getItemCount() { return youtubeVideoList.size(); } public class VideoViewHolder extends RecyclerView.ViewHolder{ WebView videoWeb; public VideoViewHolder(View itemView) { super(itemView); videoWeb = (WebView) itemView.findViewById(R.id.videoWebView); videoWeb.getSettings().setJavaScriptEnabled(true); videoWeb.setWebChromeClient(new WebChromeClient() { } ); } } } ================================================== ========================== Control+AControl+VControl+S ================================================== ========================== Modify the file: app|java|com.kiss.app10|MainActivity.java ================================================== ========================== import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import java.util.Vector; public class MainActivity extends AppCompatActivity { RecyclerView recyclerView; VectorYouTubeVideos youtubeVideos = new VectorYouTubeVideos(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); recyclerView = (RecyclerView) findViewById(R.id.recyclerView); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager( new LinearLayoutManager(this)); youtubeVideos.add( new YouTubeVideos("iframe width=\"100%\" height=\"100%\" src=\"https://www.youtube.com/embed/eWEF1Zrmdow\" frameborder=\"0\" allowfullscreen/iframe") ); youtubeVideos.add( new YouTubeVideos("iframe width=\"100%\" height=\"100%\" src=\"https://www.youtube.com/embed/KyJ71G2UxTQ\" frameborder=\"0\" allowfullscreen/iframe") ); youtubeVideos.add( new YouTubeVideos("iframe width=\"100%\" height=\"100%\" src=\"https://www.youtube.com/embed/y8Rr39jKFKU\" frameborder=\"0\" allowfullscreen/iframe") ); youtubeVideos.add( new YouTubeVideos("iframe width=\"100%\" height=\"100%\" src=\"https://www.youtube.com/embed/8Hg1tqIwIfI\" frameborder=\"0\" allowfullscreen/iframe") ); youtubeVideos.add( new YouTubeVideos("iframe width=\"100%\" height=\"100%\" src=\"https://www.youtube.com/embed/uhQ7mh_o_cM\" frameborder=\"0\" allowfullscreen/iframe") ); VideoAdapter videoAdapter = new VideoAdapter(youtubeVideos); recyclerView.setAdapter(videoAdapter); } } ================================================== ========================== Control+AControl+VControl+S ================================================== ========================== AndroidStudio321:File Sync Project with Gradle Files ================================================== ========================== https://youtu.be/bSMZknDI6bg http://android-coffee.com/wp-content...TubeVideos.apk https://youtu.be/0pOpDFsIcGk ================================================== ========================== https://android-coffee.com/tutorial-...-studio-3-1-1/ ================================================== ========================== |
Thread Tools | |
Display Modes | |
|
|