I am trying to use in app product purchase in Android App, I tried to put IInAppBillingService.aidl in many places but no one generates the Java file , here is my structure of App:
Could someone help me to find where I am wrong ?
Note: I am use using Android Studio.
There is some misplacement of directories in your project as shown in attached screenshot.
Your main directory should be inside the src directory and IInAppBillingService.aidl must be on the below mentioned path
/src/main/aidl/com/android/vending/billing/IInAppBillingService.aidl
so create a directory inside your main and then create the package as mentioned and put your .aidl file inside.
Make the necessary changes and sync Your project with gradle.
I was looking for it on the aidl folder which was wrong assumption.The java file will generate on the build, source, aidl folder.. hope this helps
Related
I just imported a project in my Android Studio. When I tried to refactor the package name, I started facing errors. I am a beginner in Android so just need your help.
When I refactored the package name by renaming the first folder after java. It did change the folder name but there were some imports in files of java (generated). Now I am unable to optimize imports in the generated files as it cannot be changed and all the changes are lost.
you are under java (generated) folder ...
those java files should not be edited...
those are generated by compiler....
it is clearly written above it should not be edited
as you said I am trying to refactor the package name just refer this this
Thanks
from Android Studio IDE file menu -> Invalidate Cache and restart -> Invalidate Cache and restart.
this should solve your errors
If you are planning to change the name of the package try this answer. what is the purpose to edit a generated file
I am trying to build apk from this repository.
I have problem: idea show .java files as invalid, you can see it on this pic:
What am I doing?
I download mentioned (git) sources and copy sources to some directory
I open this directory from IDEA as directory
In project settings I am setting Project SDK as Android 22 and create Android module in Modules section
Downloaded sources require android-support-v7-appcompat lib, so I am getting many errors, like IDEA can't find theme in xml
To remove this error, I had added library android-support-v7 in project settings, added module \android-sdk\extras\android\support\v7\appcompat\ to modules and set android-support-v7 module as dependency for my main android module
I invalidate cache and restart IDEA
After this steps I got xml's without errors about theme (because appcompat library was added), but java files are not looking valid, as I showed on picture above.
Also, I got red Main activity in AndroidManifest.xml file and I can't go to the declaration of the activity by clicking ctrl + LMB on it.
You need to specify the source dir.
Right click on com's parent folder, then Mark directory as and sources root.
Right click on java folder ->mark directory as -> sources root
https://www.jetbrains.com/idea/help/configuring-content-roots.html
Try to check you package...com.yourproject in the imports, try to import the R packge and the rest of your packge like class and other things like import com.yourproject.R.... In the Android Studio rigth click, F4 you also can ser the project proprieties....all i see is that post a awser and let me help you witj this
I have two Android projects in my Workspace. Now, I want to access the res/layout files of second project in the activity/Java class of my first project.
I have already added the second project as a library of first project but its not working. Do I need to give the path in setContentView(R.layout.main) or something like that. Please suggest.
FYI: I am working on 4.2 version of Android.
Regards,
Anupriya
I have tried with same on my end you can directly access layout file with its name
After adding library please clean project and then try to access file from resource folder of another project i.e.
setContentView(R.layout.layout_from_other_project);
You probably would need to add your own uri for library and use it to refer to drawable.
xmlns:libProj="http://schemas.android.com/apk/res/com.test.mylib"
Then you should be able to access drawable using
#libProj:drawable/myImage
So I'm trying to use the jReddit wrapper class because I am developing a reddit app on the android. Here is what I did:
I first went to jreddit and downloaded as a zip
Then I went to eclipse, made a project and copied the files from the extracted folder into the new project. Here's a picture of what it looks like:
Then I used the build.xml from here and "Ran as Ant" to create a jar file in the dist folder as you can see above
I made my android project and copied the jar file into the lib folder and built the path. The project looks like this:
Finally, here is my MainActivity.java. Sorry, I couldn't format the code properly on here
There are no errors, so I can run it on the android. However, when I click the login button to activate the function call onClickBtn, before it can even get into the function it throws an error saying: Could not find class 'im.goel.jreddit.user.User', referenced from method com.example.reddit.MainActivity.onClickBtn
Did I not import this jar in correctly or am i just not using it properly? Why is it compiling fine like it can see the user class but when run on the android it doesn't know what it is?
Extract the contents to the same folder as your other classes. Usually src.
Or
Go to project properties (Alt + Enter) and select Java Build Path (Left panel). Then select Libraries (Top middle). Click the Add External JARs button and select your jar.
I've had reports of problems with the installation of the apk.
I tried to extract the apk as a zip file and I found the folder
jsr305_annotations in the root APK
with inside
folder: v0_r47 -> file: V0_r47.gwt.xml
File: Jsr305_annotations.gwt.xml
I would like information about those files and folders and a method to make sure that they are not included in my applications
thanks
Using
Eclipse
Version: 3.8.2
Build id: M20130131-0800
Android Development Toolkit
Version: 22.0.1.v201305230001--685705
I'd seen those files included in an app as a result of including the library GoogleAdMobAdsSdk in a project (as available from here https://developers.google.com/mobile-ads-sdk/)
If you open that JAR file you can see those annotations folders and XML files are present.
If you don't include that library directly, you may be including another JAR which has those files.
I'd suggest checking the JAR files you include in your project (by opening them in a file that can open APK/Zip files) to find which one(s) include the file and look for an alternative library.
The javascript that comes with it looks like it will lock you out of your device and start making phone calls, mail, SMS, etc while it plays audio and shows a video. It also creates a *.css file and calls on varible uri. I didnt inspect every file but from the *.js file it dont look like I would want to run it. I found this in my Downloads folder, file name, "yourdownloadisready.apk", Im a tech. I cant imagine if a novice saw this.