Android Eclipse Correct Export? - java

I'm using Eclipse-plugin to develop Android applications on mac.
I've got a project and I followed the steps in 'Android Tools > Export signed Application Package' successfully, but all I end up with is a blank-icon .apk.
Is it supposed to look like that? I've followed the instructions from what I can tell.
And when I transfer it to a phone, it won't execute. It's just reads "Can't use as a valid .apk-file". For the record, the application works just fine in the emulator.
Any help on this please?

did you check taht you have an icon file inside your drawables folder?
drawable
drawable-ldpi
drawable-mdpi
drawable-hdpi
should have it at least in drawable folder but chek every folder just in case the current icon defined un any of those folder is corrupted.

Seems like I've solved the problem... somehow. it just started working for some reason.
I guess the application was signed and zip aligned as aimed for after all.

Related

Problem with icon after install again Android Studio

Some days ago I change my hard disk, so I need to re-install Android Studio. When I clone my project again some icons don't work (others are shown well). Icons are in right folder (when I have mouse hover the icon's name i can see them) and they are equal (64x64 PNG).
Some previews of the icons appear, other not. So I can't start app because the icons that don't appear are null. I don't know what happened when I install again Android Studio, because app works fine before it.
I tried to add another icon but it also doesn't appear, I tried to create another project and use the same icon but don't work and I tried to invalidate cache and nothing.
You should check on an android phone if you can download and play the app. If the problem is only with the emulator - it does get buggy, so the regular reinstalling the emulator/android studios, restarting your computer, trying to install a different emulator might work.
Otherwise:
The relevant line to look at is:
android:icon="#mipmap/ic_launcher"
This means that the app is going to the 'mipmap' folder inside your directory, and looking for a file named 'ic_launcher' - to display it as the App icon.
You need to make sure this file name exists in the proper folder, and is in the correct format(this guide might help )
How to find the image location folder
If this doesn't help: remember that icons can be displayed at different qualities for different devices (hdpi, mdpi, xhdpi....) so sometimes if you want to make your own icon you need to make sure it fits the requirements (in the above guide)
Have you tried to check if all icons are in the project folder?
"Some previews of the icons appear, other not.", From this statement of yours, means the studio cannot locate it though you can manually see theme by your eyes. This happens sometimes in the studio.
The solution is simple "Just try to reload your image files(replace them with the same files), The ones the studio can't locate".
Also you may have your app is not able to locate an image file from a 'mipmap' folder for API less than 24, you just have to navigate your studio view from Android View to Project View and move your image file from a specified folder to default image folder. ie. from drawable<24> to drawable folder then relocate your file in your code.

Building module in Android Open Source Project

I've made some edits to the code of the Android keyboard (here: https://android.googlesource.com/platform/packages/inputmethods/LatinIME/). I'm left with the folders and files: Android.mk, CleanSpec.mk, common/, dictionaries/, java-overridable/, java/,
native/, tests/, tools/.
How can I now build this as an APK I can put onto a device? I've read Google's build instructions (https://source.android.com/source/requirements.html) but I'm really unsure how to do this still. Could someone provide an idiot's guide to it, for me?
Enter the path of the Android.mk file, run mm. Checking the output and you will find the apk is in somewhere in out/target/product/...

Android Studio SDK path contains accents

I have a probelm when I'm starting a new Android project. I proceed without a problem to the last step, but when I press finish, this error appears:
Sync Android SDKs
The path
'C:\Users\Tom�\AppData\Local\Android\Sdk'
does not refer to an Android SDK.
Android Studio will use its default SDK instead:
'C:\Users\Tomáš\AppData\Local\Android\Sdk'
and will modify the project's local.properties file.
The problem is obviously caused by my user folder, which contains special characters ('á' and 'š'), because it's part of my name (I'm from the Czech Republic). Unfortunately, this folder cannot be renamed.
I have tried to change all the encodings setting to UTF-8, but it did not help at all.
I'll be grateful for every advice.
I can't help you with the localization problem, however I have had a similar issue and I hope that your problem can be resolved in a similar manor.
My advice would therefore be:
Create a new folder in your C:\ drive (name it something without special characters)
Copy and paste both your SDK and android studio to the new folder.
Enter the folder containing android studio and create a new shortcut to "studio64.exe" (for 64-bit. I think that is the right name, but I'm on my phone so I'm not sure)
I would also advice you to create another folder for your android studio projects by following step one above as the special characters may cause issues. (That was my original problem. Most things worked fine, but some were very strange indeed)

How do I build in images to my app

I have a java application. And It loads images from a directory
"C:\\Users\\elliotbewey\\Desktop\\IMGS\\BOB.png"
And it loads fine the image displays. Now If I was to compile it into a runnable jar and send it to my friend. it would not work. What would I need to do get a installer? And get system information? Help!
//note I do understand that its going to my friends computer so \\users\\elliotbewey would not work because its his computer thats what I need help with
You need to package your images inside your jar, then reference them as resources. Doing a google search for "java package images inside jar as resource" will give you a ton of results and tutorials.
This approach will work from an IDE on your computer or from a packaged jar on your friend's computer. Using an installer is definitely overkill for this goal.
Locate your images inside jar file (for example res/image.png).
Then simply call this to get BufferedImage:
BufferedImage image = ImageIO.read(YourClassName.getClass().getResourceAsStream("/res/image.png"));

My android project in Eclipse disappeared?

I wanted to create .apk file from my Android project in Eclipse, so I klicked on File --> Export --> Export Android Application. I filled required fields and I clicked finish. After that I received an error and all my application files disappear, I only have a file called "gen [Generated Java Files] and I cant open it.
I tried to search my app files manually in Windows Explorer but all is gone...
Now I don't have app files and even .apk
Where is my application?
Try to look for it in your workspace directory.
If you don't know where that is, click File > Switch Workspace, and you'll be able to see the location.
Or you could go to:
\eclipse_directory\configuration\.settings\
Open org.eclipse.ui.ide.prefs with a text editor (e.g. Notepad).
Look for RECENT_WORKSPACES. You'll find the location of your workspace there.
Just use Free Recovery to recover your deleted file.
Try it soon before anything write on that disk sector.

Categories