I need to develop a tweak that let me use some gestures in every part of the system so they must be valid in the launcher and in every app that I launch.
I think that I must override the basic android recognize touch system... and re-write part of them.
Wich are the method responsable of what I want?
Can someone post me one example of how do that?
I saw that some custom launcher (like the LG phones) use them.
Related
Sorry for my bad english.
I want to make a game for Android platform, but every time when i change my device orientation, the activity is restarted and i loss all data. I had read that i can prevent activity from being restarted by overriding onConfigurationChanged function in Android. The problem is that i make my game in Flash, with AS3 and i don't have access to Android API, therefore i must create an ANE which will handle onConfigurationChanged, but this doesn't work and i don't know why...onConfigurationChanged is not triggered when i change my orientation.
Question is - Is this possible to handle onConfigurationChanged from an ANE?
I work in FlashBuilder for Flash, and Eclipse for Java to make ANE, and there is 2 manifest files in which i can put android:configChanges="orientation|screenSize", one in Flash Builder and one in Eclipse, which of it must contain android:configChanges="orientation|screenSize" ?
I'm novice in android and ANE's and my be i do something wrong.
Are you simply trying to handle the orientation changes? You shouldn't need an ANE for this, have a look at the autoOrients and ORIENTATION_CHANGE event:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/StageOrientationEvent.html#ORIENTATION_CHANGE
If your application is restarting it's most likely something slightly amiss in your application descriptor. Just double check that you've got all the defaults in the manifest additions under the android node.
I am interested in developing a custom Android launcher which would be installed onto a device primarily for censorship. Ideally a device would divert attempts to launch applications to a service which would decide, based on a profile, whether the user would be allowed to proceed, or be shown a block screen/redirected to an informational web page.
Is it possible to detect and interrupt application launches via some kind of background service or attachable listener? Or alternatively, might it be possible to have a launcher launch a different application than the one clicked on, in order to allow for indirection?
Or, if all of this is impossible, can a service running as part of a custom launcher dynamically hide/unhide launch icons based on triggering events/messages?
There is no way to catch an app being launched and redirect that. If you think about all the horrible things people could do with this it's easy to see why. I think you're going about this in the wrong way. Instead of trying to enforce these rules with a custom launcher you should look into one of the Mobile Device Management options that are available for Android or work on creating your own.
My problem is simple and I believe I am just missing something minor, but I can not figure out what it is.
I know how to use GraphicsEnvironment, GraphicsConfiguration, and GraphicsDevice. I know how to get all the showing devices etc., etc.. And I know how to display to a specific device.
The only thing I can't figure out is if the user's desktop is extended, duplicated, or showing to an individual monitor?
The GraphicsDevice is not necessarily equivalent to a hardware device, but to a 'display' that can be used by the Java application. So, when the user's desktop is duplicated or showing an individual monitor, even if there's a second monitor (hardware) connected or not, getScreenDevices (from GraphicsEnvironment) shows only one GraphicsDevice. Thus, I believe that you won't be able to identify these settings using this Java API.
Your solution probably will require JNI code. The project Lightweight Java Game Library has something like that, take a look at the Display class.
Is it at all possible to create an App Widget programmatically from within an Android app itself? I'm rather lost on how to do this and Googling so far has led me to believe that it is not possible (that an App Widget and an App itself has to be separate applications).
So, would it be possible to dynamically create an App Widget from within an Android App? If not possible, how would you approach it? Thanks all!
Is it at all possible to create an App Widget programmatically from within an Android app itself?
That would depend completely upon what you mean by this.
I'm rather lost on how to do this and Googling so far has led me to believe that it is not possible (that an App Widget and an App itself has to be separate applications).
No, an app widget most certainly can go in the same Android project as the rest of the application. In fact, usually it does.
So, would it be possible to dynamically create an App Widget from within an Android App?
Again, you seem to think that the world knows what you mean by "dynamically", forcing us to guess.
An app widget, from the standpoint of code, consists of an AppWidgetProvider, an entry in the manifest pointing to that AppWidgetProvider, a metadata XML file, and whatever other resources you need (layouts, drawables, etc). All of that has to be written by a programmer and included in the app at compile time -- you cannot "dynamically" create those things.
An instance of an app widget is put on the home screen by the user, not by the programmer. Hence, a programmer cannot "dynamically" create instances of an app widget.
What the programmer can do "dynamically" is decide what is displayed inside of the app widget (e.g., current headlines for a news ticker, current song being played for a music player).
I'm working on a game which would work both on the web, as an applet, and on the Android phone, as an app.
Is that possible to do, and if so, what do I need to be aware of to make that work (i.e if there are any settings that I shouldn't hard code and instead determine them based on the user's device when the game is run, or any java libraries that I shouldn't use?).
Also, the game needs to accept touchscreen as input for the Android app. Is that possible to build into the same game which will also be run as an applet? May be so at run time, the applet decides whether to use Mouse or Touchscreen for the input when it is run?
Although Android apps are written in Java, the framework around the app is extremely different of the framework wrapped around an applet. You won't be able to have one .jar file that you can include as an applet and throw at an Android device because that's just not how it works.
You will however probably be able to create all the game logic and objects and have them in be shared with the applet code and android app. You can probably even get away with having them in one repository and project (although it's probably going to have to be an Android project that you then wedge in your app build scripts).
In order to tackle the different controls for your game you are probably going to have to abstract away the input, and have your game/level object have a call back like userHasPoked(int x, int y) and then have the applet call that method on click of the mouse and the android app calls it on touch (which is oddly still called onClick).
I think it'll be a long road, but much easier than rewriting the whole thing. It'll probably seem like a lot more work up front, but once you are done wedging your code into an applet and an Android app, you'll probably "never" have to touch that code again and can just keep adding to the game.
I wouldn't underestimate the task, but that sounds like a very fun programming exercise. Good luck!
What kind of game do you develop? It may be the better approach to develop an Javascript game.
That can be installed with phonegap (cordova) onto an android device.
Let me break this for you....
Model - The Business Logic and Data
View - The Display of the Output of the Model
Controller - On which the action is done.
The advantage of using this MVC architecture is that, you can keep the same model and keep changing the Views.
So keeping this idea in mind, you can have the same model for both the Web App and the Android App, and then implement each others Views to it respectively.