First I want to reference my "research". I'm new to the Android environment, not to Java, but I could say I've sometimes failed to understand the concepts that lead to logical errors. It's been my experience that I usually don't have to think too much about setup, diving right into code. It's also been one one of the things that have held me back.
This to say that the error I'm experiencing now may be because of a fundamental misunderstanding of the compiling-linking mechanism on Java or on Android specifically. I want to change that.
Primarily this question is for an explanation on this subject, concentrating on learning enough to update this text so that I can give an apt explanation of what's really going on and why I was stuck with this problem for so long.
Specifically, I'm using the demo app to test on my device, having the app go "Unfortunately, has stopped". I've followed each step outlined here with repetition and variance in each case following previous answer, especially this answer, which seems to describe a very similar scenario to mine.
I could use a quick fix, but this answer I think deserves a better explanation. Solutions associated with this question seem to depend on what exactly the user has in his environment/the order with which libraries are compiled/the folders within which these libraries are placed. So if anyone has a deeper understanding of what exactly is going on here I would certainly appreciate the visualization.
I can share my own code files (which are copies of the my_location_demo) but I have no logcat as I'm exporting to dropbox to test on my own device.
UPDATE
Does anyone know if I need to declare my library resources in my manifest file? Here it says to declare all external library activity. My current manifest file includes the following:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyCvGBr5in13NK2yYBR7lhXTtnxj3mrXQy4"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
I am looking into the logcat suggestions, although I do not have a rooted device, nor one running <=4.1 But I had this running a while back, this cannot be so difficult.
UPDATE 2
Right now I got the demo app functioning, this is what I did: 1.Created new workspace.
2.Imported Google Play Services lib (Copy into workspace because i have 2 Drives, this only works when both files are in the same drive)
3.I noticed that androi v4 support library was already added.
4.Changed API key accordingly on manifest (which already had all necesary permissions).
Since this was the demo app it already has some setting i cannot decipher. I obviously want to apply this to my own app. I tried reproducing the same procedure and i noticed the file icon (to the left of the name in the file explorer on eclipse) was missing a symbol for Library, in contrast to my previously succesful demo project.
I referenced that through "Add JAR" in the Java build path libraries tab.
With these options my app gets to a loading map, but crashes before it shows anything.
I referenced the google play through "Add External JAR" in the java build path libraries tab as well, and I didn't get to the map, which takes me "further" away, so I removed it and got the map to 'almost' load again, at least.
UPDATE 3
In the next Image I'd like to point out the only difference I can still find while comparing the demo app (working) with two versions of my app. The bottom red rectangle highlights what I mean about the working project having an android-support-v4.jar with a library icon on its left. The next red highlight box shows one of the project instances I have, where the file is shown to not have the same library icon on its left. The last two red boxes from bottom up highlight how I tried to convert that file into a library, the top red box being a new 'file' that appeared when I made the reference to the library.
The one that 'seems' to work (gets to map controls, but shows no map and crashes) is the top instance.
UPDATE 4
I added this line GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());
to my onCreate as suggested here. Which resulted in getting to actually load a MAP (omg im so close) with controls. GPS icon on the top system tray is flashing (acquiring location) and a colorful map appears on the grid, but it still crashes after 5-7 seconds.
UPDATE 5
It's possible that I may have acomplished something, but I think i just lost my time. I added a TextView that was present in the initial tutorial (i didn't need it) to the code and now everything is working (almost fine). I'm guessing I haven't read enough of Layouts to understand how much that needs to be set up.I still have some bugs but at least i can see the map and it's pinging my location. Again,
Many thanks.