Many many issues, eclipse, android MediaPlayer, etc - android

I've recently started android programming, and I'm extremely frustrated to say the least with a lot of things that to me seem simple but are totally holding me back from making any progress. The first of which is the "my first app" hello world that I started a tutorial from http://developer.android.com/training/basics/firstapp/creating-project.html
This tutorial worked fine when I was originally looking into android a while ago. Then when I came back after learning a bunch of java this program will no longer work unless I change the target-sdk to version 10 (I found that solution after extensive searching on this site).
Then I moved on to starting tutorials by thenewboston
All of these work fine as long as I didn't use any new targetsdkversion, so I'm wondering what happened that everywhere I go looking for tutorials I can't find anything that will actually work on the current ADT(4.4W and L are what my eclipse automatically set up) and eclipse (indigo). I'll also get issues saying lint isn't working, or trouble with android SDK content loader when I'm not even doing anything.
I've also found snippets of code example on the developer website that I linked earlier that don't work when implemented either
So, am I missing something, is that just old documentation, or is something up with eclipse and ADT? I'm just so frustrated that everything wants to bug out on me when I'm just trying to follow simple introductory tutorials and I don't even know where to turn for tutorials that I can trust to work..
edit:removed code because it wasn't needed.

To not get blocked What you can do is continue to set "targetVersion as '19'" instead of setting it to 20 or so. Ensure that you've downloaded API19 through SDK Manager and create the AVDs with that targetSDK version for checking you apps.
That way you can proceed ahead with your coding and later when things get resolved by google for API20...you can always comeback to that new version. This way you can follow 'TheNewBoston' and start coding in Android.
I also recommend 'Slidenerd' tutorials over youtube as well for the beginner.
BTW, I've also selected 'Blank Activity / Empty Activity" during the project creation with API19 and been able to move ahead with my coding.
The Google Bug thread about this latest version issue can be tracked here : The google bug

As a beginning developer, I suggest you use API 19. It has been out for a while and is more stable than L or Google Wear.

Related

Getting an App APK

Hey guys and girls for a the past week I've grown a lot of interest in android studio (even without knowing quite much about it) I decided to create an app that I deemed quite useful. However the app required maps to be integrated in it and I really did not know what I was doing and at one point I started messing with the settings and then all hell broke loose and I kept getting AAPT2 errors and I even tried to fix this issue with the gradle properties line that you add (I forgot the line of code to add). Anyways it still didnt work. However I rembered that I always kept the good version (before I broke everything) of the app on my phone. So when I go in my phone the app is there and it works just fine. Ive tried so many things to get the source code from the app on my phone without any succes. My question is, how can I get the source code back from the working app onto my laptop to continue coding in android studio? If it helps I am using Linux 18.04 LTS and running the newest version of android studio. Thank you for any help from you guys. This means a lot to me.
You can’t get back the ‘source code’ from an already compiled app.
You should consider using some version control platforms like git from the next time

Android Eclipse public class error

I know this question has already been asked here link1 and here link2 but neither have a proper solution so I'm hoping that someone may now know a solution as it's driving me insane.
I'm new to android app design using Eclipse and I created a simple "Hello World" app and wanted to test it but I can't because I'm getting the error:This class should be public (android.support.v7.internal.widget.ActionBarView.HomeView).
I never had this problem come up yesterday and today I haven't altered my code at all but the error pops up when I run Lint Warnings; stopping me from running the test emulator.
Does anyone have a solution to this problem at all or why it's suddenly appeared out of nowhere?
This has been logged as a bug: https://code.google.com/p/android/issues/detail?id=73265
If you've only created a hello world app, I'm a little unsure why you would need to pull in anything from the support libraries. The top answer on the second link should work (making sure lint flags it as a warning and not an error), but you could also make sure you set the target API level higher. I would suggest API 14 based on *current market share

Beginning Android 4.0 Application Development by Wei-Meng Lee Eclipse Version Error

I am a android beginner. I am going through the book listed in the title. I haven't even made it past the first chapter without running into problems. I have installed the latest version of Eclipse. However, the examples shown in the book are not much like my version. For instance, this main.xml file that's supposed to be in the layout folder is not there. The "New Android Project" dialog box is arranged very differently and the package explorer is called project explorer. Is there a way to get this kind of eclipse in the book? Or do I just have to interpret it best I can? Any help would be much appreciated! This question has been down voted and closed by another user. Could someone please tell me why? I am just trying to get some help.
As different Android APIs(ICS, JB, etc.) are released, they sometimes change the ADT (Android Development Tools) for Eclipse. The ADT is plugin for Eclipse. This plugin is what gives you all those neat buttons in the toolbar and the XML layout interaction.
The book you are reading was designed for Android 4.0(Ice Cream Sandwhich). As of right now, Google has released up to Android 4.2.2(JB 4.2). There has been some significant changes to the ADT going from ICS to JB, but in my opinion, they are for the good. Lots of really neat and new features. Here is a Google resource explaining the different API releases for Android: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels
I would say continue reading the book as it will teachs you the basics of Android, but when you want to do some in depth coding, that book isn't going to be very useful and you may have to do a little research online. Reason is, Google releases at least two new versions of Android every year. Every version changes, and adds new features. In other words, the book you are reading is already out of date. Android OS development moves way to fast for authors to keep updating their books.
To answer your question, your probably going to have to interpret it the best you can since, most likely, by June/July, Key Lime Pie is going to out, and the ADT your using NOW will be outdated. You should really learn the fundamentals of Android OS and how it works in the background and how processes things. After that, everything else should be easier to learn.
An alternative to the book you are reading is this: http://developer.android.com/training/basics/firstapp/index.html. This is straight from Google and is constantly updated and tweeked. This will be the most updated and useful information on how to write Android apps.
Hope that helps!

New Android Eclipse version won't get to workspace

I'm trying to start out with Android programming (I'm running Mac OS X Lion). I had an old version of Eclipse and installed ADT version 20 in it, and code didn't compile properly. Fine; I hadn't done much in there, and after reading some stuff here it sounded like the easiest thing for the long run would be to put together a completely new installation.
So I downloaded the latest version of Android, with the SDK, from the Android developer Getting Started site, and ran it (in its own directory). I loaded one of my previous workspaces and it said that one wouldn't work because the ADT was version 20 and it needs 21. I figured fine, there wasn't much in there and I'd just start a new workspace.
So I started a new workspace, and here's where the real trouble came: It gives me the start screen with newbie welcome instructions but won't go any further than that. When I try to create a new Android Application Project, it goes through the menus but as soon as I click Finish I get a please-wait circular icon, and little happens. There's a line at the bottom that says "66M of 142M" - it increases slowly into the 80s and then drops back down into the 60s, endlessly. And the links provided on the welcome page (Building Your First App, etc.) don't work - I click on them and nothing happens.
Any idea what's going wrong here? Is there some cruft left over in my system from older versions, which I should delete? If so, how should I go about doing that? If not, what else might I try to get it working?
I can't comment beneath yours because of my level, but you can help Eclipse run faster by giving it more memory. Doing this speeds things up quite a bit.
As far as installations go, maybe try Google's packaged version of Eclipse + Android SDK. The whole package is available here. It's already preconfigured to work and provides eclipse with ADT installed by default. Of course, if you already have an existing Eclipse you want to modify this won't help you too much. But if you're new to Eclipse it's a good way to get started with Android development.

Incorporating both Contacts and ContactsContract into an Android application

Greetings all,
I realize this issue has been posed before in other forms, and believe me, I have been searching the net for days trying to find the answer. However, I'm fairly new to Android and Java, and I need a little guidance please.
I presently have two version of my app, one for Android 1.5 and 1.6, and another for 2.0 and beyond. As you probably guessed, it's because the Contacts API is different.
I recently became aware that it was possible to combine both methods into a single app, by using dynamically loadable classes. Very cool! After days of attempts, I still haven't been able to do it successfully... or at least, it won't run.
I have come across 3 examples of how to do this - one by Google, called "Business Card", another that had something to do with Spinners, and a 3rd was something someone here created. My problem is that each one seems to me to have a showstopper.
I'm using Eclipse on Windows 7. My app was first created for A1.5, so that's the one I'm upgrading. What's happening is that my ContactsAccessorNewApi class needs to import the ContactContracts, and according to Eclipse, that won't work because my project was originally built without support for it. Hence, it won't run. I've tried adding the android.jar for SDK level 5 into the project, but that creates a whole mess of other problems.
My code for this pat of my app is exactly like the Google example "Business Card" - so if someone could help me cross this hurdle, I'd be very grateful. I'll be happy to post any code that you need to answer my question.
Thank you!
another that had something to do with Spinners
If you mean this sample project, that's mine.
I'm using Eclipse on Windows 7. My app was first created for A1.5, so that's the one I'm upgrading. What's happening is that my ContactsAccessorNewApi class needs to import the ContactContracts, and according to Eclipse, that won't work because my project was originally built without support for it.
You need to set your build target (Project Properties > Android) to be high enough that ContactsContract exists (android-5 or higher).
So long as your android:minSdkVersion in your manifest is set to support earlier versions of Android (e.g., 3 for Android 1.5), your app will still install on older emulator AVDs and devices.
I've tried adding the android.jar for SDK level 5 into the project, but that creates a whole mess of other problems.
Yeah, don't do that.

Categories

Resources