generate blank aidl file - android

This may sound stupid but for some reason I can't find anywhere on Eclipse that lets me generate blank .aidl files... Does anyone know how?

You could make a copy form this:
http://developer.android.com/guide/developing/tools/aidl.html
and than use something liek th ecode2code eclips eplugin to generate code from the template you have created..

There is no option (yet, I guess) to create a aidl file. You should just create a file (right click on the package -> new file ) and give it name with .aidl extension. Then in this file you should just add several lines:
The name of the package, for instance package com.test;
And just declare interface IYourName { }
So as you can do only several things with android interface, there is no need to make a separate template for this.

Related

AndroidStudio not recognizing .java file

For some unknown reason, android studio decided not to recognize the .java file. Any idea how to resolve this?
I've tried deleting the file and recreating it, but it still results in the same issue. When recreating the file, some error came up and the file is automatically recreated
public class SubmitDealAsyncTask extends AsyncTask<Void, Void, String> {
...
}
It turns out that there's a wrong file association entry which associate that particular filename as a JavaFX file.
Look in the Preferences > Editor > File Types under Java files, the name of SubmitDealAsyncTask.java file is there and all I needed to do is to remove it.
Check your java file name and Class name.
class SubmitAsyncTask {}
should be saved in "SubmitAsyncTask.java"
Go to Preferences > Editor > File Types > Java, and then under each of the listed file types (Yes, unfortunately you have to look through all of them), and scroll down at the bottom of the to see if there is an entry for you file, and then click on it and the click the - sign.
How did you include this file? I had problems just copying java classes in Android Studio, so maybe you might want to create a new java class and copy the content of the desired file into it. Then there should be no problem.
Try to copy all the code from this file and paste it inside your package(where you paint over you name with blue lines).
Android Studio will create new .java file for you there.
#root I created the class by right clicking on the package folder(com.example.tttt) in the project view and then new java class and naming it SubmitAsyncTask and then using the prototype you provided to create a dummy class and it worked for me as you can see below so if this doesn't solve it then you are missing something in the code its no longer an IDE problem :

Where do I put haarcascade_frontalface_alt.xml in the Android sample of JavaCV's FacePreview class?

There's a snippet of code in the Android sample's FacePreview class that boggles me:
File classifierFile = Loader.extractResource(getClass(),
"/org/bytedeco/javacv/facepreview/haarcascade_frontalface_alt.xml",
context.getCacheDir(), "classifier", ".xml");
I know I should change the names before haarcascade_frontalface_alt.xml to match my project name, but I can't figure out where to actually put the XML file in my project structure.
I did read somewhere that I have to put the xml file in the same folder as the FacePreview class... so does that mean I have to put it in src/main/java/<package_name>?
Edit: That doesn't work either. Do I have to download and cache it in the Activity?
it goes in src/main/resources/org/bytedeco/javacv/facepreview/haarcascade_frontalface_alt.xml
assuming gradle does the right thing

Android Eclipse - package folder not "normal" in src folder

Someone please fix my title. This problem is so weird that I have no idea what to call it.
Here is what my src folder should, and usually does, look like in my Package Explorer view:
Here is what is looks like now:
I don't remember what I did to do this (Eclipse is the most buggy program I've ever used in my life). I think it might have happened when I was attempting to create a JAR file with my classes.
The problem with this is:
My app always crashes on startup.
I don't have error messages. I could write iynbiun in my classes and there would be no red underline. It will always let me run (therefore compile my classes) my app even with uncompilable code.
How can I make it go back to the way it was in the first image?
A little help for you.
Just create a new package named as com.mikeyaworski.calculator as it before(make sure same package name is inside gen folder).
Then drag the calculator folder from com.mikeyaworski to com.mikeyaworski.calculator.
I think after this step you just have to rename the package because after dragging of calculator folder the package should be renamed as com.mikeyaworski.calculator.calculator.
So just rename it as usual and delete the empty com.mikeyaworski package.
As my knowledge if our package name is com.mikeyaworski.abcd then all activities are saved inside com folder -> mikeyaworski folder -> abcd folder .
Sometimes due to some changes the package path destroys and all our android related classes becomes plane java files. So if we reconstruct the package path and put all java classes inside this it must be as before.

imported classes not working

I'm doing a calculator tutorial online, and there is two separate classes that need to be imported into the main class
I put the two classes in a new package in the scr folder and tried importing them into main class like so
import com.example.brkyclasses.Alertwindow;
import com.example.brkyclasses.Calculator2;
Eclipse is still asking me to create methods when the methods are in the two classes is there something else i need to do, do i need to add these two classes to manifest or something else
Those are package specific imports. You need to look in your manifest xml and see what your package name is under the package tag (should be like 3rd line). And then you will probably create some file called Alertwindow and Calculator2 and so you will import your own classes. using the package.name.Alertwindow format.
You need to add either the source code for those classes, or the .jar file that those classes are implemented in, to your project. If you included the .jar, you need to edit your project settings and specify the location of the .jar

I have several of these in my Android project in Eclipse - what is this?

What kind of folder type is this and how can I create this?
The name is basically a source folder hierachy of a project library I include. But I do not know what this actually is and how to create this. Looking at the file structre in Finder I don't see anything. So I guess it must be some kind of link or so.
this is the symbol I try to understand ->
Many thanks for your help!
This is a folder Icon.
Top Right + mark kind indicates it is a source.
Bottom Right with ! indicates that there are some warnings in your code. Look for the Errorlog to remove the warnings.
This is created by Eclipse, as soon as you create a new package, which internally creates a folder for each part of the package name.
Example: If you have com.android.myproject
then eclipse, will create a folder for Src, inside this a com foler, then inside this an android folder and finally myproject folder.

Categories

Resources