How to take a picture of in panaroma mode? - java

I want to make an application that allow the user to take a picture of text either from android device Gallery or from android Camera application in a Panorama mode .But i can not find any source or tutorial to do this.How can i do this in my application? how to make an application that take picture from android camera application in a panaroma mode?
Thanks in advance.

I don't know if it's still actual for you, but hope it will be helpful for someone.
Panorama feature is already implemented in standard android camera at least since Android 4.0 (perhaps it was available in even earlier versions but I'm not sure, you can check it), so since source code is open for everyone, it might be the easiest way just to copy required functionality.
Although you can download source of apps from https://android.googlesource.com/ (you want LegacyCamera or Camera), you can't just open project of any standard app in Eclipse or other IDE. For example, LegacyCamera depends on Gallery2 and other dependences that might be hard to be resolved.
I spent several days trying to move panorama feature to separate project. You can download it from here: https://github.com/yankeppey/PanoramaSample . Several remarks:
Functional core (creating one panorama image from several ones, progress notices, etc) is on native part.
I used java code from from LegacyCamera which was used in Android 4.0-4.1, not 4.2, because it was significantly easier for me. Native part is taken from 4.2, it has only minor changes inside and almost the same JNI interfaces.
This project is just to help you move panorama feature to your own app, it's not like kind of library, don't expect clean code without bugs, it's just pretty dirty and buggy project. If I have time I'll try to make it cleaner, but there is no warranty :)

Related

How do I run an apk on J2ME?

Whats up! I just want to ask, but how do I run an .apk file j2me. I know that this question HAS been asked, but I can't seem to find an answer. Also, i'm not asking to run j2me apps on android; there are already tons of emulators. Im asking for apks running on j2me. I also know that they are developed in different VMs. So, is there any way to do that? Also, another side note, how do i resize the screen of an apk file? Thanks!
-Apersonwithalaptop22
(Edited to be easier to be understood)
You don't. A J2ME environment wouldn't have the Android framework. You'd need to write a complete android framework in the j2me language. It's not as simple as just converting dalvik bytecode to jvm bytecode- it's actually providing every single android class in the SDK. It could be done, but it would take one person a few years to do, and some things would never work quite right. Possibly you can find a project that's tried to start that effort, although I would doubt it- android moves relatively rapidly for them to keep up, and j2me is basically dead.
As for resizing the screen of an APK file- you don't. APK files don't have a screen size. Instead the idea is to write a UI that scales.

Using android palette class in desktop java application

Android developers have created a great class to isolate colors from an image
https://android.googlesource.com/platform/frameworks/support/+/refs/heads/master/v7/palette/src/android/support/v7/graphics/Palette.java
However I could really use this in a desktop application. I tried ripping the class from the library (as recommended to me , during a Devox java conference by one of the android devs) but he probably didn't realize I would have to drag half of the android library with me then eg: Bitmap, Color
Does anyone know of a tool that might be able to strip the classes I need retroactivly from the library, or give me a better way to solve my original problem, a java class that will give me the dominant colors of an image together with their inverse and adjoining colors ? I can't write it from scratch cause we just don't have the budget/time to do that :(
I stumbled upon your question and I also found this lightweight library on github that is a port of one of the javascript libraries that Chris Banes references in the blog post mentioned above.
It's pretty good at extracting the primary color for images quickly. I would still love it if someone had a way to extract something like what android calls the "vibrant" color. Ideally I would love a way to mimic exactly what happens in the android library so i could have a seamless experience between my android, desktop, and ios experiences. I still haven't found that one yet.
Another Java port - https://github.com/trickl/palette. I wrote this one myself (I was unaware of the existence of other ports at the time). It's a pretty direct port and includes a bunch of the original tests.
There is this Palette ported library. You can use it in your Gradle based java project by adding jcenter() to your repositories and the next dependency into your build.gradle file.
dependencies {
...
compile "com.loyalsound:iris:1.1"
}

How to use javaanpr in Android app?

I would like to use this library for Car plate recognition in my Android app.
I red about JNI, but i'm still not able to get some good explained tutorial, how can i use use this library in my Android app.
http://javaanpr.sourceforge.net/
Thanks for any advice.
In it's current state, you will not be able to use JavaANPR on Android. The problem is, that JavaANPR's core functions use the java.awt package quite heavily (for example Photo.java) and Android doesn't support AWT mostly (AWT contains native code, and Android has it's own android.graphics package). There have been some attempts to port AWT to Android, but AFAIK they all failed/died eventually.
Disclaimer: A while ago, I forked JavaANPR in order to make it more library-like. It shouldn't be too hard to port the AWT code in JavaANPR to android.graphics though and you are more than welcome to submit a pull request!

"One App" Android System

I created an Android app which communicates via USART with a µC in order to evaluate data. My co-workers and customers should use the tablet for only this purpose now. Is there any possibility to "hide" the Android OS or making it inaccessible?
Devices are rooted and I am willing to build custom ROMs (even though I do not have any experience with that yet). Are there any approaches available that I do not have to start from scratch?
Many thanks for your help.
Well. That what I'm trying to do !
The first thing I tried was to start the app just after the boot of the device (Quite easy with this).
Then, I get Android source code, and I hide the bottom bar using this code
The problem is, if your application is not stable ... you'll have some problem.
If you want to modify Android source code, the developper doc contains a very good tutorial to start !

Build Android native library with Adobe Air

I'm currently working on an Android application built with Adobe Air sdk, in AS3. I was wondering if it's possible to compile a kind of UI library that I can import in a Android native application (Java). Basically, I would like to build my UI with Adobe Air, but the main part of my application with Java, the native way.
What I have in mind is to convert the adobe air-generated APK into a Jar file I would import in the native application project, and call some functions that display something on the Screen.
Is it possible? I think it may be possible, because when I don't import Adobe Air SDK in the application, I must install Adobe Air application with the Play Store to make my application working. I don't find lot of things on Google about that :s.
Thank you for your help.
Yes it can be done (in theory), but hold on to your hat, it's a bumpy ride!
I see it is a very old question, with a new bounty (the questioner has not logged on for 3 years!), but here we go...
This method goes to the heart of how android java apps are constructed and run (i.e. DEX, so it will work with adobe-air or ANYTHING, it is fundamental [general method]). (by the way you use the word native in a confusing way, native is commonly understood to mean the JNI (c++) library element of an app).
You say:
"What I have in mind is to convert the adobe air-generated APK into a
Jar file I would import in the native application project, and call
some functions that display something on the Screen."
Android programs are compiled into .dex (Dalvik Executable)[now called ART but binary compatible] files,
which are in turn zipped into a single .apk file on the device (with other things like the manifest and resources). (unzip a .apk and look inside).
A .jar file contains DEX files (zipped). (unzip a compiled .jar and look inside).
I have done some work like this before, here's a link to a tutorial and coding examples [tested by me] (in android studio + gradle) [custom build elements are usually needed (I also give an ant example)].
See my stack-overflow answer Dynamic loading of DEX files
This in theory answers your question, but it's fundamental stuff, complex and has limitations that make it hard to code and maintain (resources are a real pain in the a**e).
Question: This all seems very complicated and hard !
Yes it is ! It is an increadably silly an difficult thing to do! That is why we invented cross platform frameworks, (and for web based code javascript/css/html5...). Failing that PORT the code.
I'm more of a Flash/AS3 coder than Java so can't give you a full answer but...
A better approach might be to just render your SWF-based User Interface itself via Java code (as opposed to compiling SWF into APK format then trying to embed Flash APK inside Android APK).
This way your SWF can also communicate with Java functions (via AS3's external Interface class). Making it easier to trigger Java functions when a button on the SWF U.I is pressed etc..
You just have to find an SWF render library for Java.
Maybe check out SWFTools. Particularly the SWF Class looks promising. I have not tested this library but it might help you.
I am not a Adobe AIR developer at all, however, I have developed a few Android App with both native environment and with some kind of framework (specifically PhoneGap). So, may this can help you.
I don't think that there would be any tool which could directly convert mobile apps build using frameworks like Adobe AIR, PhoneGap or any other HTML5 based framework to a native Android app because technically it is very difficult and unfeasible to do a proper mapping between each and every element of HTML5 (or Flex element in your case) to a corresponding native control or logic. The best you can do is use plugin mechanism provided by your framework to interact with Java and vice-versa and basically that is why the framework is there. For most of HTML5 based frameworks there is a plugin mechanism which allows developer to interact with native functionality (like Background Services, Activity or any other native resource). Even these frameworks are build using the same modular or plugin based approach and there major functionality (accessing Camera, Audio, SD Card etc native resources) works like this. We have to enable that feature before using that in our app.
So, look for plugin type of mechanism in Adobe AIR.
Hope this helps.
Maybe this is a dirty way to help you, but you can :
Install the adobe air program in one computer
Copy the files of the install folder of the adobe air program
Embed all this files in the java application
Install the java application
Save the adobe air files in one folder
Start the adobe air with java (like you will do it with the console, a simple call to YourAirApp.exe)

Categories

Resources