|
I have an rotated textview and I want to drag and drop this view.
The problem is that the drag shadow has no rotation.
I found a solution for android in java but this does not work for me.
Maybe I translate the code wrong
<a href="https://stackoverflow.com/questions/17049938/how-to-drag-a-rotated-dragshadow"></a>[<a href="https://stackoverflow.com/questions/17049938/how-to-drag-a-rotated-dragshadow" target="_blank" title="New Window">^</a>]
class CustomDragShdowBuilder : View.DragShadowBuilder
{
private View _view;
public CustomDragShdowBuilder(View view)
{
_view = view;
}
public override void OnDrawShadow(Canvas canvas)
{
double rotationRad = Math.ToRadians(_view.Rotation);
int w = (int)(_view.Width * _view.ScaleX);
int h = (int)(_view.Height * _view.ScaleY);
double s = Math.Abs(Math.Sin(rotationRad));
double c = Math.Abs(Math.Cos(rotationRad));
int width = (int)(w * c + h * s);
int height = (int)(w * s + h * c);
canvas.Scale(_view.ScaleX, _view.ScaleY, width / 2, height / 2);
canvas.Rotate(_view.Rotation, width / 2, height / 2);
canvas.Translate((width - _view.Width) / 2, (height - _view.Height) / 2);
base.OnDrawShadow(canvas);
}
public override void OnProvideShadowMetrics(Point shadowSize, Point shadowTouchPoint)
{
shadowTouchPoint.Set(shadowSize.X / 2, shadowSize.Y / 2);
base.OnProvideShadowMetrics(shadowSize, shadowTouchPoint);
}
|
|
|
|
|
can someone help me about when i take a picture of a money specifically paper bill, it will recognize what is the value of that money using opencv in android?
|
|
|
|
|
This is a common question; google for "image recognition and OCR".
|
|
|
|
|
I once read an article on how to extract the letters and numbers from a picture of a license plate. It was a fun read but was completely beyond me. I suppose the same would be true in this case. Image processing is a huge and complicated field. I did stumble across this as maybe a starting point.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
i heard that android can connect a remote computer by using IP address of the PC. How is it done? thanks
|
|
|
|
|
Just the same as any remote connection (e.g by the web browser), it is done by using network sockets. See java.net | Android Developers[^] for details.
|
|
|
|
|
Android Studio
S'il vous plait
Je voudrai afficher les contacts du telephone
dans un onglet.Quelqu'un pourra me guider??
Merci bien
Translation:
Android Studio
Please
I would like to display the contacts of the phone in a tab. Can someone guide me?
Thank you
|
|
|
|
|
|
I am looking for a command-utility that will tell me if a particular device is connected to the home network. (TV and Home Theatre in particular). These devices are not responding to a Ping, so that does not help. NMap does not find them either (not sure why), even with its most intense scan. Fing finds them OK, but only seems to be available in with a GUI, and I need to be able to capture the response in Tasker. They do also appear on my routers' "Attached Devices" pages.
Note that my programming skills have deteriorated significantly over recent months due to my brain injury, so I am unable to write anything from scratch (Its taken me 5 days to even set up tasker to a point that would have taken me 2 hours a couple of years ago).
If anyone is able to help, it would be very much appreciated.
Cheers,
Mick
------------------------------------------------
A programmer is a person who always checks both ways when crossing a one-way street.
|
|
|
|
|
Try net view , but I don't know if that is available in Android.
|
|
|
|
|
Thanks Richard - I'll take a look at that one when I wake up in the morning, and let you know how it goes.
Cheers,
Mick
------------------------------------------------
A programmer is a person who always checks both ways when crossing a one-way street.
|
|
|
|
|
No - not android. It looks like it might have to be the Fing API and write one. Wish me luck. I hope I still have that much skill (not confident though).
Cheers,
Mick
------------------------------------------------
A programmer is a person who always checks both ways when crossing a one-way street.
|
|
|
|
|
Midi_Mick wrote: I am looking for a command-utility... For Android?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Yes, for Android. The device I am using is a slightly older (but not too old) phone, which I have rooted and loaded Tasker and a Terminal Emulator on. It makes the thing like a cut-down Linux (which Android is based on, anyway). Tasker will happily run a Shell command, and capture both the stdout and stderr streams for me.
Cheers,
Mick
------------------------------------------------
A programmer is a person who always checks both ways when crossing a one-way street.
|
|
|
|
|
Midi_Mick wrote: ...and loaded Tasker This is the Tasker app that I use, but for completely different reasons. Is there another one out there?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
That's the one - it can be an incredibly powerful tool, particularly when given superuser privileges. When creating an action, take a look at the "Code" option, and you will see "Shell Command". I also have a plugin for it (RM Plugin - designed primarily to control the RM series of IR blasters) that has a built-in mini server that will execute tasks when it receives a URL. That means I can utilise IFTTT to control just about anything.
But it does not solve my problem - the IR remotes for the TV and the Home Theatre is just a power toggle, not separate On and Off. So I need to know if the device is already on or not so that when I say "Turn on the TV", it doesn't just send the signal and actually turn it off. Detecting its existence (or not) on the network will answer that question, so Tasker can decide whether or not to send the IR signal.
Cheers,
Mick
------------------------------------------------
A programmer is a person who always checks both ways when crossing a one-way street.
|
|
|
|
|
Midi_Mick wrote: That's the one... Have you considered asking here on how to capture the output of a shell command?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I can already do that - what I need is the command that will get the info for me.
Cheers,
Mick
------------------------------------------------
A programmer is a person who always checks both ways when crossing a one-way street.
|
|
|
|
|
As you previously indicated PING would not work, how about TRACERT?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
That was a good suggestion. TRACERT is Windows, but a bit of research gave me traceroute, which is the Linux equivalent. I needed BusyBox on the android device to get that command, and it works fine for the TV. However, for the Home Theatre, it finds it whether it is turned on or not. Very close, but note quite time for the cigar yet.
I have a support request in with Fing - that seems to be the only program that is giving me the right answers - to see if there is any way of capturing its output. They do have an API available, and its not expensive - but I am concerned I no longer have the skills to use it to write the utility.
Cheers,
Mick
------------------------------------------------
A programmer is a person who always checks both ways when crossing a one-way street.
|
|
|
|
|
Previously, the moment I connected my Android to my PC with a USB cable, Windows Explorer recognized him and gave me access to just about any folder in the phone.
That has stopped happening now.
I connect via USB cable, Windows Explorer does see the Android phone, but I cannot access any of the folders on the Android.
Suggestions are welcome, thank you
Windows 7
I think I bought this in 2012
This Android was acquired this year
|
|
|
|
|
|
Perfect.
Genius.
Thank you.
Exactly what I needed to know
(And voted +1)
|
|
|
|
|
Which Android Emulator can run on Windows 7? Do you have a link to download?
I need Emulator for smartphone, not for tablet.
Thank You!!!
|
|
|
|
|
I use both Eclipse and Visual Studio for Android development on Win7. They both come with an emulator. What IDE are you using?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|