1. Are you ready for the Galaxy S20? Here is everything we know so far!

quickstart, sample code, missing project icon, importing & sdk versions

Discussion in 'Android Development' started by Ben Coman, Jul 6, 2017.

  1. Ben Coman

    Ben Coman Lurker
    Thread Starter

    greetings all,

    I normally put a lot more effort into sorting these things out but I'm in the middle of a two week hackthon I need to learn some parts of Android Studio quickly. So apologies that rather than doing the tutorial linearly, I'm jumping around to focus on my immediate prototyping needs, which is a single screen moving two graphic entities in relation to each other.

    I did the FirstApp tutorial fine, and now jumped to Building an OpenGL ES Environment. So this is a super dumb question, but when I "Download The Sample" OpenGLES.zip and unzip it in under AndroidStudioProjects, none of its directories have a green icon like FirstApp. What are the implications of that?

    I presume a "Project" needs to be created and OpenGLES.zip unzipped somewhere under that. What is the best location to unzip to? Are there any basic tutorials that describe this sort of code importing?

    Ahh... in framing my question I discovered the right search term and found this about importing. So...
    + Import project (Eclipse ADT, Gradle, etc.)
    + Selected OpenGL\HelloOpenGLES10
    Wow, that took five minutes to import.

    --------------------
    Now I got a "Error:Failed to find target with hash string 'android-4' in: C:\Users\Ben\AppData\Local\Android\Sdk
    <a href="install.android.platform">Install missing platform(s) and sync project</a>

    HelloOpenGLES20 imported immediately (so I guess earlier five minutes was downloading dependencies?),
    and this one gives me...
    Error:Failed to find target with hash string 'android-8' in: C:\Users\Ben\AppData\Local\Android\Sdk
    <a href="install.android.platform">Install missing platform(s) and sync project</a>

    Are these errors maybe related to Tools > Android > SDK Manager?
    where for Appearance & Behaviour > System Settings > Android SDK
    I've installed _only_ Android 6.0 (Mashmallow) API 23,
    since that is the specific phone I'm prototyping on and my bandwidth is poor.

    Must I install Android API 8? Or can I just tell the project to use API 23 instead? Apparently I can since here pointer me to HelloOpenGLES20\app\src\build.gradle with...
    android {
    compileSdkVersion 8
    buildToolsVersion "26.0.0"
    defaultConfig {
    applicationId "com.example.android.opengl"
    minSdkVersion 8
    targetSdkVersion 17
    }

    and the following allowed it to build...
    android {
    compileSdkVersion 23
    buildToolsVersion "26.0.0"
    defaultConfig {
    applicationId "com.example.android.opengl"
    minSdkVersion 23
    targetSdkVersion 23
    }

    In the light-yellow header bar it mentioned that "Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly". There was a [Try Again] link that didn't do anything until after my update to all 23, so that "seems" to have been one right way to proceed. So now on the emulator I've got a spinning triangle. Cool! and much better than where I was a short while ago.

    So I guess my question ends up being, have I missed anything obvious? or that I could have been done better?

    cheers -ben
     

    Attached Files:




    1. Download the Forums for Android™ app!


      Download

       
  2. Ben Coman

    Ben Coman Lurker
    Thread Starter

    btw, would there be any reason to not just concentrate on GLES20?
     
  3. Deleted User

    Deleted User Guest

    Your strategy of increasing the minimum SDK is fine. Generally speaking, the more current you can make your project, the better, as older SDKs can introduce a certain amount of 'baggage' into your code. APIs become deprecated and sometimes your code has to include some clunky conditional blocks.
     
Loading...
Similar Threads - quickstart sample code
  1. fun and education
    Replies:
    0
    Views:
    313
  2. KNOW_HOW_PROTECTION
    Replies:
    1
    Views:
    389
  3. _wigfield_
    Replies:
    3
    Views:
    1,182
  4. KerenSophia
    Replies:
    0
    Views:
    283
  5. Sunny Rio
    Replies:
    1
    Views:
    578
  6. Kaweesi Samson
    Replies:
    1
    Views:
    1,551
  7. Dev101
    Replies:
    0
    Views:
    1,343
  8. Fatbomb
    Replies:
    2
    Views:
    983
  9. Denis Bogatov
    Replies:
    2
    Views:
    1,033
  10. kilohercas
    Replies:
    0
    Views:
    2,113

Share This Page

Loading...