API Compatibility

Is there any way to access api / UI for copy / paste on Android / HTC Sense phone?

I really like how long printing works on a large canvas when using Sense. Is there a way to programmatically detect that the code runs on a Sense phone and calls these APIs?

+6
android copy paste htcsense
source share
3 answers

No, of course not. There is only one API for copy / paste in Android, although implementation details may vary between skins if you can call it an API even because it is provided for free if you select the right user interface elements.

I also do not know what you mean by "the way long printing works on large canvas when using Sense." When I compare text copying and text selection in the stock of Android and HTC Sense, it is basically the same (except for colors, etc.). Could you clarify your question?

Edit: Perhaps you meant this: Add my application to HTC, cut and paste the send menu

+2
source share

Ok, I have to be honest here, I have not played with android yet, although I am going to do it soon. However, I was working on a Microsoft Surface table.

If the standard android library does not implement functionality to detect any touch and hold event, I suggest the following:

I think you could easily implement such an assistant yourself. What you probably want to do is add a listener to the touch event of this canvas. The moment your finger touches the canvas, you start the timer. When the timer ends, you fire your desired event. However, you will also need to implement several other things. When the finger moves beyond a certain threshold or the finger rises again, the timer must be stopped and cleaned so that it no longer works.

In this scenario, you created the touch and hold script for yourself. All you have to pay attention to is that you turn it off when adding touch manipulations.

(I really believe that the standard sensory library should contain something similar to this functionality!)


From what I could find with a few searches, it was:

@Override public void onLongPress(MotionEvent e) { //Call your own custom copy paste dialog here. } 

(Otherwise, you can find something to your taste in the GestureDetector?)

The copypaste function uses the ClipboardManager. All you need to do is create a pop-up menu containing copies and pasting images with the appropriate text and hooks for this ClipboardManager.

+1
source share

I'm also new to Android development, but I think you're looking for the R.id class. Here's a link to the API documentation:

http://developer.android.com/reference/android/R.id.html

It looks like this:

menu.add (0, android.R.id.copy, menuIndex ++, android.R.string.copy);

menu.add (0, android.R.id.paste, menuIndex ++, android.R.string.paste);

Good luck with your application!

Sam

0
source share

All Articles