w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
selecting CRAN mirror from remote device
Per ?install.packages: repos character vector, the base URL(s) of the repositories to use, e.g., the URL of a CRAN mirror such as "http://cran.us.r-project.org". So do something like install.packages("hglm", repos="http://cran.us.r-project.org"). Insert the url to St Andrews instead.

Categories : R

Android go to device all apps screen
This is not possible. First, there is no requirement that a home screen have an "all apps screen". Second, there is no standard Intent structure to lead the user to an "all apps screen", even if one exists.

Categories : Android

Is it possible to send a computer's screen to an Android device?
Let's do some math. A 1080p screen is 1920×1080 pixels. In a bitmap, each pixel is 4 bytes (a,r,g,b). You want 60 of them per second. That ends up being 497664000 bytes/second, or 497 MB/s. 802.11n is up to 150 megabits/s. So no, you can't realistically do it without compression. Now add in compression, and/or reduce your framerate goal and it becomes doable. Edit: another technique (one used in video processing as well) would be to send only the parts which changed. That would be the best way to save bandwidth, and the idea that would probably come closest to your goal. Most frames are probably 90%+ identical.

Categories : Java

Screen refresh time of an android device
You can override the onDraw method of a TextView to find out when it's actually redrawn. public class MyTextView extends android.widget.TextView { private long mUpdateTime; public MyTextView(Context context) { super(context); } public void mySetText(CharSequence text) { mUpdateTime = System.currentTimeMillis(); super.setText(text); } @Override public void onDraw(Canvas c) { super.onDraw(c); long refreshTime = System.currentTimeMillis() - mUpdateTime; //Do something with refreshTime } }

Categories : Android

Android screen capture on rooted device
Take a look at this articles: http://android-chirag.blogspot.com.br/2012/06/video-recording-example-in-android.html http://android-er.blogspot.com.br/2011/04/simple-exercise-of-video-capture-using.html

Categories : Android

how to lock device but prevent the screen to be turned off in android?
Along with your lockNow(), add PowerManager.WakeLock: Import import android.os.PowerManager; Global Variable protected PowerManager.WakeLock mWakeLock; Public Methods public void pullWakeLock() { final PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); this.mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag"); this.mWakeLock.acquire(); } public void releaseWakeLock() { this.mWakeLock.release(); } Use the follwing permission in manifest file : <uses-permission android:name="android.permission.WAKE_LOCK" />

Categories : Java

As android device screen is bigger, buttons are upper
//try like this below one #remove the margin top 102dp #don't use button background image use color with white stroke #make your button width as match parent and minheight= 100dp as ur need. #add android:gravity="center" to your parent layout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background" android:gravity="center" tools:context=".BasicScreenActivity" > <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignPa

Categories : Android

Android "screen redraw" developer device setting
Found it. It tried "Show GPU overdraw", but it didn't do anything. It seems I had to close the settings menu for it to become active, which I didn't do previously. I don't know in which version it was implemented, but it's there in 4.2.2

Categories : Android

Android - Scaling image being captured of device screen
Am using Canvas to scale an image which is been snapshot. No compromising the quality/clarity of image. Canvas bitmapCanvas = new Canvas(); bitmap = Bitmap.createBitmap(view.getWidth()*2, view.getHeight()*2, Bitmap.Config.ARGB_8888); bitmapCanvas.setBitmap(bitmap); bitmapCanvas.scale(2.0f, 2.0f); view.draw(bitmapCanvas); Make sure you give only power of 2, other wise improper scaling results. Originally answered here.

Categories : Android

Screen gets rotated even after locking device's rotation in Android
If you look at this question you should find your answer link. You have to set android:screenOrientation="landscape" Best wishes

Categories : Java

Android resizing based on device screen size
Simply, ImageView webLink = (ImageView) findViewById(R.id.btnWebLink); webLink is null. Check your layout xml: are you sure the name (btnWebLink) is correct? Are you sure you're loading the correct layout xml file? Probabily you have the ImageView in one layout but Android is loading the layout for a specific screen size where there's no btnWebLink. Have a breakpoint in that line and check if the variable webLink is null. The null pointer exception comes the first time you try to use the variable.

Categories : Android

How do i detect when android device screen is about to timeout or "Lock"?
You will need to register a broadcast reciever.Your system will send a brodcast when device is going to sleep. Put the following code wherever desired: private BroadcastReceiver receiver = new BroadcastReceiver() { public void onReceive(final Context context, final Intent intent) { //check if the broadcast is our desired one if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) //here define your method to be executed when screen is going to sleep }}; you will need to register your receiver: IntentFilter regFilter = new IntentFilter(); // get device sleep evernt regFilter .addAction(Intent.ACTION_SCREEN_OFF); registerReceiver(receiver, regFilter ); ACTION_SCREEN_OFF is sent after the screen turns off and ACTION_SCREEN_ON is sent after the screen turns on. UPDATE: 1.Meth

Categories : Android

How to make my toy android calculator UI fits with the device screen
from documentation: Limitations: GridLayout does not provide support for the principle of weight, as defined in weight. In general, it is not therefore possible to configure a GridLayout to distribute excess space between multiple components. Some common use-cases may nevertheless be accommodated as follows. To place equal amounts of space around a component in a cell group; use CENTER alignment (or gravity). For complete control over excess space distribution in a row or column; use a LinearLayout subview to hold the components in the associated cell group. When using either of these techniques, bear in mind that cell groups may be defined to overlap. Source try using LinearLayouts for the children, like: <LinearLayout android:layout_width="match_

Categories : Android

Scale multiple Android ImageViews to All Fit on Screen Regardless of Device Size
Yes I have had this problem before. Refer to my other answers: Placing a point at specific position on different screen densities and Resizing images from server What you need to do is find how much larger this new screen is than your old one, by first getting the dimensions of your device that you are testing on and putting them in for widthOfStandardDevice and heightOfStandardDevice.Once you know how much larger the new screen is then your test one using DisplayMetrics, you make two multipliers to multiply everything by so that the position and size is the same relative to the screen size. DisplayMetrics displaymetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); height = displaymetrics.heightPixels; width = displaymetrics.widthPixels

Categories : Android

Android Lock Screen App Widget: how to wake up the device (and send it back to sleep again after)
Well, I used a Handler to call wl.release() after 60 seconds: public class AppWidget extends AppWidgetProvider { @Override public void onUpdate(Context ctxt, AppWidgetManager mgr, int[] appWidgetIds) { ComponentName thisWidget = new ComponentName(ctxt, AppWidget.class); int[] allWidgetIds = mgr.getAppWidgetIds(thisWidget); Intent i = new Intent(ctxt, UpdateService.class); i.putExtra("widgetsids", allWidgetIds); ctxt.startService(i); PowerManager pm = (PowerManager) ctxt .getSystemService(Context.POWER_SERVICE); final WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, "bbbb"); wl.acquire(); final Handler handler = new Handler(); handler.postDelayed(new Runnable() {

Categories : Android

How to Increase sleep time of Pixelsense device , when it is in surface mode
I got the solution , I would like to share the link http://technet.microsoft.com/en-us/library/gg697101.aspx From the above link you can change that on your device to whatever you need with a registry change. Thanks

Categories : Misc

How to push without the default --mirror option in a mirror repo
Just edit your .git/config and unset remote.<remote>.mirror, as is explained in git help push: --mirror Instead of naming each ref to push, specifies that all refs under refs/ (which includes but is not limited to refs/heads/, refs/remotes/, and refs/tags/) be mirrored to the remote repository. Newly created local refs will be pushed to the remote end, locally updated refs will be force updated on the remote end, and deleted refs will be removed from the remote end. This is the default if the configuration option remote..mirror is set.

Categories : GIT

PhoneGap "Hello World" launches in android emulator but no default PhoneGap "Device is ready" Screen
Ok, after a couple of weeks scratching my head around this I finally figured out what the problem was. I was using the PhoneGap CLI to build an android project against the bin directory. For some reason, when I opened Eclipse and started a new project with existing code (according to the PhoneGap documentation) somehow it produced an incomlplete java file. I discovered this by comparing a working application's java file with my one and realized the code was different. So, instead of using the CLI, I simply opened Eclipse, and started a new project from the "example" folder in the PhoneGap android directory and ran the project - it worked!

Categories : Android

How to find the 3D coordinates of a surface from the click location of the mouse on the ILNumerics surface plots?
The conversion from 2D mouse coordinates to 3D 'model' coordinates is possible - under some limitations: The conversion is not unambiguous. The mouse event only provides 2 dimensions: X and Y screen coordinates. In the 3D model there might be more than one point 'behind' this 2D screen point. Therefore, the best you can get is to compute a line in 3D, starting at the camera and ending in infinite depth. While in theory it would be possible at least to try to find the crossing of the line with the 3D objects, ILNumerics currently does not. Even in the simple case of a surface it is easy to construct a 3D model which crosses the line at more than one point. For a simplified situation a solution exists: If the Z coordinate in 3D does not matter, one can use common matrix conversions in or

Categories : Misc

How to fit screen as per device/screen resolution?
In extjs not able to differentiate laptop and desktop device. I have gone different way. but this not correct way. we can achive as per requirement. In view globally calculating height of the screen. if screen resolution is 1600X900 (Desktop) window.ineerHeight will be come more than 700. if screen resolution is less than 1600x900 window.innerHeight will be less than 700. So here calculating dynamic value assigning to component. it is working very nicely for me. Cheers Here is my code: if(window.innerHeight>700){ var paddingValue = 10; var imgHeight = window.innerHeight/4.1; //Desktop } else{ var paddingValue = window.innerHeight/35; var imgHeight = window.innerHeight/5.7; //Laptop }

Categories : Javascript

Arabic mirror of layout issue in Android
How to set up RTL layout mirroring To set up RTL layout mirroring in your app, perform the following steps: Add android:supportsRtl=”true” to the <application> element in your Android manifest file. In the Android manifest file, change all of your app’s “left/right” layout properties to new “start/end” equivalents. For example, android:paddingLeft should become android:paddingStart. just follow this link http://developer.sonymobile.com/2015/06/09/enable-worldwide-usability-for-your-apps-with-bi-directional-language-support/

Categories : Android

How to create mirror image of textview in Android?
public class MainActivity extends Activity { TextView tv; ImageView myImageView; Bitmap bmp; int bmpWidth, bmpHeight; Matrix matrixMirrorY; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tv=(TextView)findViewById(R.id.textView1); myImageView=(ImageView)findViewById(R.id.imageView1); tv.setDrawingCacheEnabled(true); tv.buildDrawingCache(); bmp=Bitmap.createBitmap(tv.getDrawingCache()); Matrix matrix = new Matrix(); matrix.preScale(-1.0f, 1.0f); Bitmap mirroredBitmap = Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, false); myImageView.setImageBitmap(mirroredBitmap);

Categories : Android

Trying to mirror a picture with java android canvas.drawImage
Following will work for you. I found it somewhere on SO itself but don't remember where. public static Bitmap getReflectionedBitmap(Context context,int resourceId,Bitmap originalImage,int reflectionGap) { if(originalImage==null) originalImage = BitmapFactory.decodeResource(context.getResources(),resourceId); int width = originalImage.getWidth(); int height = originalImage.getHeight(); // This will not scale but will flip on the Y axis Matrix matrix = new Matrix(); matrix.preScale(1, -1); // Create a Bitmap with the flip matix applied to it. // We only want the bottom half of the image Bitmap reflectionImage = Bitmap.createBitmap(originalImage, 0, height / 2, width, height / 2, matrix, false)

Categories : Java

Android flip front camera mirror flipped video
You have to apply a matrix transformation, like such: if(isFrontCamera) { m.preScale(-ratio, ratio); } else { m.preScale(ratio, ratio); } Assuming you don't resize anything the ration would be 1, making the non-front camera preScale obsolete.

Categories : Android

Android Emulator and AVD will not run on Surface Pro
After serious research and internet searching I have found the perfect solution for Android Emulation on the Microsoft Windows 8 Surface Pro: Bluestacks is great for running and testing .apk files compiled with the Android SDK ADT bundle and Eclipse IDE. First follow these instructions to install Bluestacks successfully on the Surface Pro. If the graphic drivers have been updated you may get a Bluestacks 25000 Graphics Card Error, if this is the case you will need to rollback your graphic drivers by doing the following: http://answers.microsoft.com/en-us/windows/forum/windows_8-hardware/latest-graphics-driver-update-makes-bluestacks/1f67d99f-3626-4110-aa22-773856b226cb Method 1: I would suggest you to roll back to the previous driver. a) Press Windows key + X on the keyboard. b)

Categories : Android

how to position Views on an Android screen relative to the screen edges using offsets in terms of pixel position on the screen coordinates?
You can put a margin to your element to move it away from the edge. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" <!-- move it to the top left corner --> android:layout_alignParentLeft="true" <!-- move it to the top left corner --> android:layout_marginTop="10dp" <!-- move it 10dp down --> android:layout_marginLeft="10dp" <!-- move it 10dp right --> android:text="@string/hello_world" /> </RelativeLayout>

Categories : Android

curved surface from points in 3D space with ANDROID
Drawing such plots basically means dealing with a height map. In general, you define a math function value(x, y) that returns height, then you draw it as a grid with even spaces between points. for x = -10...10 step 1 for z = -10...10 step 1 addVertex(x, myHeightMap(x, z), z) Here is a great resource for you I think: http://en.wikibooks.org/wiki/OpenGL_Programming/Scientific_OpenGL_Tutorial_04 Simple example: http://3dengine.org/Draw_a_grid

Categories : Android

Android - MediaRecorder - Apllication lost the surface
The possible reason is that Surface instance will be completely created only after MediaRecorder instance does. The solution is to place the SurfaceView initialization (the first fragment of code in question) to onStart() in activity. It will guarantee that creation of Surface with all corresponding callbacks will be finished before MediaRecorder initialisation.

Categories : Android

what is SurfaceView SurfaceHolder Surface Camera API android
Here are some definitions: A Surface is an object holding pixels that are being composited to the screen. Every window you see on the screen (a dialog, your full-screen activity, the status bar) has its own surface that it draws in to, and Surface Flinger renders these to the final display in their correct Z-order. A surface typically has more than one buffer (usually two) to do double-buffered rendering: the application can be drawing its next UI state while the surface flinger is compositing the screen using the last buffer, without needing to wait for the application to finish drawing. A window is basically like you think of a window on the desktop. It has a single Surface in which the contents of the window is rendered. An application interacts with the Window Manager to create windo

Categories : Android

How to finger paint on Surface View In Android?
You have a good example in API Demo: FingerPaint you can find it in the sample of your android sdk: C:ANDROID-SDKsamplesandroid17ApiDemossrccomexampleandroidapisgraphics

Categories : Android

android device does not show up under Android Device Chooser
Make sure you are using the correct android API and SDK version compatible with your device's version in the code. (In the android SDK for eclipse this is in Android Manifest.xml) If the two don't match up, then they won't show up when you try to test it on the device.

Categories : Android

Eclipse Android Emulator not working on Microsoft Surface Pro
Right-click the program's icon and choose Properties. When the Properties dialog box appears, click the Compatibility tab and then click the Run Compatibility Troubleshooter button. Windows 8 tries to guess what version of Windows your program needs, and then it applies the changes. If the program begins working, you're through. If the program still has trouble, though, move to Step 3. In the Compatibility Mode section, select the Run This Program in Compatibility Mode For check box and select the program's desired Windows version from the drop-down list. http://www.reddit.com/r/Surface/comments/1ael60/surface_pro_and_dj_software_also_android/

Categories : Android

GLSurfaceView: position of camera, looking at Surface, changes with android version?
Not sure if this is the issue you are having, but try changing the following line: gl.Orthof(0, widht, height, 0, -1, 1); to gl.Orthof(0, widht, height, 0, 1, -1); Notice that the near/far values are inverted. See this for a description of this maddness :)

Categories : Android

Bitmap texture does not show up in framebuffer surface on Android
So I finally figured it out myself after over clocking quite a few of the little grey cells. The issue is with computeOutputVertices(); This might have worked with a GLSurfaceView, but for some reason, whatever its doing is not compatible with a PBuffer. Just comment that line out and it works beautifully.

Categories : Android

How to connect Android device to an iOS device over BLE (Bluetooth Low Energy)
I've written a simple working example, well relatively simple, and included it open-source on Github: https://github.com/GitGarage. So far it has only been tested with an Android Nexus 9 and an iPhone 5s, but I presume it would also work with a Nexus 6 and various iPhone types. So far it is set up explicitly to communicate between one Android and one iPhone, but I presume it is tweakable to do much more.

Categories : Android

How can i create new virtual mouse device on my android device?
From what i see you should create your own virtual device with your own driver , Fortunately there is an easy way to do so using uinput There is an easy guide for getting started here , and this question can be a good guide to write your own virtual driver. I thought this can only be done if you have access to kernel , and create your own ( i dont think modifying user rom is a good solution ) , but after reading this , it is clear that Uinput can run in user mode. Note : I agree with recommendition to use touch events ; as this solution is more common and makes sense , check second suggestion is this answer

Categories : Android

How can i Write data from Android device on c2540c device?
Might this solve your problem?

Categories : Android

Android Device device shows Unknown (?????) in eclipse
You need to add vendor ID to android.rules file. Please follow this link to know about particular vendor id & how to do this. http://developer.android.com/tools/device.html

Categories : Android

How to track the device location (iOS and Android) device using Phonegap
The first thing to say is that creating a Phonegap app that receives location updates while running in the background is entirely possible, but not trivial. I've done it myself and released apps on both the Android and iOS platforms. If you need accurate and regular position updates, I'd suggest using the GPS receiver on the target devices. In Phonegap, you can do this setting the "highAccuracy" flag when requesting position updates. The watchPosition() function will deliver new position information as and when the device receives updates from the GPS receiver, so you use it something like this: navigator.geolocation.watchPosition(successCallback, errorCallback, { enableHighAccuracy: true, timeout: 10000, maximumAge: 0 }); See the Phonegap geolocation API documentation for more d

Categories : Android

AlarmManager keeps screen of my device on
From the AlarmManager reference documents: The parameter AlarmManager.RTC_WAKEUP, will wake up the device (in case of device sleep) to deliver the Alarm. You may use AlarmManager.RTC but that won't be wake up the device and your Alarm won't be delivered until next time device wakes up. A better option would be to use a Service for this purpose, as they are designed to carry out the background tasks.

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.