I'm developing a simple plugin to Unity Android, that displays an image from the web.
I've created a Jar using my Java files, and loaded it (in a blank Unity sample application) using AndroidJavaClass.
All worked fine, but then I've wanted to rename my Java package.
From now on - I can't see the image. The plugin doesn't even trying to access it.
I've changed the package name in the Java files, and also in the AndroidManifest.xml and in the CS file that's calling it.
The Jar compiles successfully, the application runs on the device, but... nothing.
I've also created a new application that uses the plugin with his new name, but no success.
What have I done wrong?
Or - what can I do to make it work?
Thanks,
Keren
Why would you code a plug-in to display a web image ?
Just use unity native WWW call, then put the result in a texture.
Look at the unity docs.
Related
I'm using monaca(onsenui-react) to create cordova app.
After type monaca preview I have checked app on browser like this.
But the index.html wasn't one I expected.
I mean have edited the www/index.html, but it's not loaded on browser.(I don't know what index.html was loaded)
Of course I typed monaca preview after edit www/index.html.
Does anyone can help me?
You need to run monaca transpile to transpile (kind of a compilation) your code into the www folder.
Using monaca preview will use the "webpack.dev.config.js" configuration to generate a compilation to a temporary folder. Using the "transpile" command will use the "webpack.prod.config.js" to compile your code into the www folder.
One more thing: monaca uses a strage combination of folders and package versions (most of them deprecated) to transpile, so I recommend you to do this manually if you are not using the monaca tools (the online paid stuff).
Recently I made a repo with everything already set up (using Onsen UI and React, also Redux - which is easily removable), using the latest version for every npm package (Webpack 2 being the most important, instead of the version 1 used by monaca) and keeping everything in your project folder (in your package.json, like it should be). You can find it here.
I am new to Phonegap and I am currently developing an android app using jquery mobile and Phonegap.
I googled a lot on how to use the downloader plugin and how to call it in your Html file which contains the link of the file you want to download with the downloader plugin but couldn't find any working example.
Can anyone here please provide me with a simple working demo of the PhoneGap downloader plugin so that I will get relevant information on how to use it. Or help me in implementing the plugin and calling it on the specific url.
Thanks in advance. :)
I've used a downloader plugin quite a long time ago with phonegap 2.2 and it was quite easy to use.
Is this the plugin you are trying to use? or maybe this one?
The fist one seems to have been updated for the phonegap 2.7+ format so maybe usable in a phonegap 3 project, except that you won't be able to install using the CLI and will have to had the plugin manually in platform/android or you could write a plugin.xml yourself.
To use it, you just have to follow the instructions in the readme.md or read the original article in http://www.toforge.com/2011/02/phonegap-android-plugin-for-download-files-from-url-on-sd-card/
Again I haven't tried to use it in recent versions of phonegap and am not sure if the plugin should be updated to be compatible.
Edit:
For each file you have to call:
window.plugins.downloader.downloadFile("http://server/file.txt", {overwrite: true},
function(res) {
//function called when the file is downloaded
//the file content is in res
}, function(error) {
//function called in case of error
}
);
if you need to download several files, you could download the next file in the function called in case of success.
I was asked to make a project work in Android and I am a complete noob in this aspect and, well... things are not working...
I have created a little code in Java which uses libraries - this code works perfectly. I am now trying to make this code work on Android but I have problems...
It seems I cannot use any element from the libraries I imported to my Android project. The project loads on the phone perfectly fine when no instance of the library is created, but when I make use of the library the app crashed and I get errors.
http://i.imgur.com/OILHQ.jpg
Here is what the project package looks like
http://i.imgur.com/HQEX9.jpg
The part with the arrow is what I think makes the program crashed. When I remove this line, everything works fine.
I checked online about problems with Android and external libraries but I could not understand everything... Could you help me pinpoint exactly what is wrong and how to solve this?
Thanks!
I got this issue when I first started android development.
Key to this is to the external library seems to require them being another android project itself, instead of java project. After creating this android project, right click on the "external project" and choose properties. Under Android Tab, there should be something to check to denote that it is a library instead of application. After doing this, the linking is quite similar to how we link normal java projects to external java library
If you are using eclipse, than just create a "libs" folder in project root and drop your external libraries there.
Alternatively you Right-click on the jar file > build path > add to build path
I am trying to introduce a new API on the custom android 4.0.3 image.
I have used the \device\sample project and created a new device sdk-addon based on it,
I have added my own java add-on library code and the build is happens perfectly fine, when compiled with 'make PRODUCT-mysample_addon-sdk_​addon'
The output is available in the out\host\linux-x86\sdk_addon\ as a ZIP file
I am able to install the zip file in the sdk add-on directory, create new avd with my custom add-on and launch the emulator.
When I create new android UI application using the new add-on I created, the application builds using my new custom API but when I try to run it on device, the addon class is not found and I get java.lang.​NoClassDefFoundError.
The Jar and odex are located in /system/framework directory, the JAR file contains only the manifest the ODEX contains the actual class information.
I am not sure what more entries needs to be done, I got hint from someone that adding the class reference in BOOTCLASSPATH in init.rc will help, I have also tried but it does not seems to work.
Please suggest if you have any idea.
The solution answered elsewhere was to add
<uses-library android:name="<library-package>"/>
in AndroidManifest.xml of the application.
I have an application for Android using phonegap 1.3.0 and was trying to update to 1.5 (Cordova).
I switched the .jar file, the XML file, and the JS file, and the application builds fine.
But when I run the application and try to access the FileSystem it fires an error with code 5 (FileError.ENCODING_ERR, supposedly).
If I run the Eclipse project which has the 1.3 version, I have no problem at all.
I think this is a bug in Android's Cordova 1.5.
FileUtils.java:161 assumes that the arg[1] is a file name not a full path.
But if you look at cordova-android-1.5.0.js:2360 they are passing the path as the second arg, for which you probably provided something like "file:///mnt/sdcard/somefile.data".
So when this path is given to FileUtils.java:129 as a filename, it fails the check on line 640, and throws a EncodingException. To fix it, make sure you send the fileName and not a path or URL.