Android :: How To Take Screenshot In Programmatic Way?

Aug 4, 2009

How can I take a screenshot programmatically? So far I've learned that:

1) DDMS does it by sending "framebuffer:" to the adb service over a socket, which takes a screenshot in framebuffer_service.c that it sends back.
2) There are some proprietary screenshot apps out there that stipulate the user must have root access, I'm not sure why.

Would it be possible for an Android app to send "framebuffer:" to its own adb service and get the screenshot that way?

Android :: How to Take Screenshot in Programmatic Way?


Android :: Declarative (XML) Vs Programmatic UI

Apr 1, 2010

Has anyone seen or compiled benchmarks comparing declarative (XML) versus programmatically created UI's in Android? There are things that Google has done to speed up the declarative approach, but you still do have the layout inflation step done at runtime. Have you ever switched (or considered) changing your UI from declarative to programmatic for any reason?

View 1 Replies View Related

Android :: How To Set HTTP Proxy In Programmatic Way?

Sep 2, 2010

I'm looking for a programmatic way to set-up http proxy settings for android handsets. I've tried using android.provider.Settings.System.putString() to set System.HTTP_PROXY, but my call fails (I'm using a 2.2 emulator image at the moment). My code looks like:
if (System.putString(getContentResolver(), System.HTTP_PROXY, "10.10.2.1:8080")) {
tv.append("put for HTTP_PROXY succeeded. ");
} else { tv.append("put for HTTP_PROXY failed. "); }

I've also added to my android manifest:
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
Although it's not clear from the docs which permission, if any, is required.

I'm familiar with this SO thread, but the technique there requires manual adb commands, which require the SDK tools and (possibly) a rooted phone. Is there a way to accomplish this? Ideally, I'd like away to set an http proxy that will be used for both data and WiFi connections.

View 1 Replies View Related

Android :: Programmatic UI - Setting IDs Of Some Elements

Feb 3, 2010

I need to add some parts of my UI programmatically. I'm doing this because I need to set the ids of some elements up in such a way that they can be easily access in a for loop. So far I have this xml:

<?xml version="1.0" encoding="utf-8"?> <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/attr_row" android:layout_width="fill_parent"
android:layout_height="wrap_content"> <EditText android:id="@+id/attr_name"
android:hint="Attribute" android:layout_width="0dip" android:layout_weight="2"
android:layout_height="wrap_content" android:inputType="textPersonName" />
<EditText android:id="@+id/attr_val" android:hint="Value"
android:layout_width="0dip" android:layout_weight="3"
android:layout_height="wrap_content" android:inputType="textPersonName" />
<ImageButton android:id="@+id/drop_attr" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:background="@drawable/btn_delete_states"
android:layout_gravity="center_vertical" /> </LinearLayout>

At the moment, I inflate this xml five times like so:
for (int i = 0; i<5; i++) { LinearLayout attrList = (LinearLayout) findViewById (R.id.attr_list);
LayoutInflater inflater = getLayoutInflater();
View row = inflater.inflate(R.layout.attr_row, null);
LinearLayout extraAttr = (LinearLayout) row.findViewById (R.id.attr_row);
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);
attrList.addView(extraAttr, i, params); }

The link below shows two pictures - the layout hierarchy and the result in the emulator. http://picasaweb.google.com/bengoldcross/Android?authkey=Gv1sRgCJ785I...
As can be seen, the xml is inflated five times successfully but only one is actually displayed. Inspecting the hierarchy viewer a bit more explains why. The layout being displayed is at location x=0 y=111 all the others are being rendered at x=320 y=111. It would appear they are being displayed a) off screen and b) on top of each other. So, why are they and how do I stop it from happening?

View 3 Replies View Related

Android :: Programmatic Frame Layout Used As Button

Aug 26, 2010

Been stuck on this for a while and tried a few various things.Basically I've overridden frame layout to create myself a custom button. The frame layout has two children a button and a linearlayout with items in it.The problem is I'm trying to the get the button to stretch to the size of the frame layout (i.e. fill parent) and it isn't doing.

View 1 Replies View Related

Android :: How To Mount SD Card In Programmatic Manner?

Sep 15, 2010

I want to mount SD card programmatic, how can I check?

View 1 Replies View Related

Android :: Programmatic SD Card Mounting / Unmounting

Mar 1, 2010

I'm wondering how programmatic sd card mounting/unmounting can be achieved while the handset is connected to a pc via USB. I cannot find any managed API for that and also my jni attempts failed with errno: 1, [Operation not permitted] error.

View 1 Replies View Related

Android :: Email Programmatic Setup And Modification

May 12, 2010

I wanted to know if it is even possible to either set up or modify email account settings programmatically. I do not believe it is, due to email applications controlling their own settings (and thus would depend upon a ContentProvider from that specific client), but I have not yet found a definitive "no", either.

Further, I was wondering about the email account support on Android in general. It appears that Android 2.0 and above will allow for multiple ActiveSync/Exchange accounts and mulitple IMAP/POP3 accounts, and displays these in the same inbox. Is this claim true? Also, how is this different from the other major Android releases (Android 1.5 and 1.6)?

View 1 Replies View Related

Android :: Programmatic Way To Read System Logs?

Feb 3, 2010

Is there a programmatic way to read the system logs? i know they are stored in /dev/log.

View 4 Replies View Related

Android :: Difference Between Manifest And Programmatic Registering Of BroadcastReceiver

Sep 6, 2010

I am trying to understand the main differences between registering a BroadcastReceiver in the Manifest and registering it programmatically...

My understanding is basically as follows - would appreciate someone correcting my points if I am missing something.

Registered in Manifest:
- The OS will magically find and instantiate your class if needed, calling the onReceive() method, regardless what the running state of your application was
- Your receive will only get called once per broadcast (i.e. You can consider that registering in the manifest is like registering your 'class' for receiving the broadcast - and the broadcast instantiates your class as needed) (??)

Registered Programmatically:
- registering in code means that you are registering instances of your class to receive broadcast messages (i.e. if your code is a little sloppy, and you manage to register several times, you will end up with multiple BroadcastReceiver instances all having their onReceive() called for a broadcast
- to deregister, you need to deregister the specific BroadcastReceiver instance that you previously registered
- if your application gets destroyed by the OS, your onReceive() method will not be called for a broadcast

View 1 Replies View Related

Android :: Programmatic Screen Capture On Mobile Device

Aug 27, 2010

I would like to implement some sort of remote assistance tool (like vnc) for Android. Is there the possibility to capture a screen programmatically on the device?

View 3 Replies View Related

Android :: Relative Layout XML Attributes Have No Obvious Programmatic Equivalent

Jun 16, 2009

If a RelativeLayout must be generated at run time, what are the equivalent API calls for the attributes set in the XML Layout editor? Take for example this very simple RelativeLayout that places the second ImageView to the right of the first ImageView:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/ android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="horizontal" android:background="@drawable/ bg_sunrise"
android:layout_gravity="center" android:gravity="center">
<ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/icon"></ ImageView>
<ImageView android:id="@+id/ImageView02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/ ImageView01" android:src="@drawable/icon"></ImageView> </RelativeLayout>

Of the many, variations I tried, I had the most hope for this one, but it didn't work either:

protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
RelativeLayout layout = new RelativeLayout(this);
layout.setLayoutParams( new ViewGroup.LayoutParams (
LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT ) );
ImageView imageView1 = new ImageView(this);
imageView1.setImageResource(R.drawable.icon);
imageView1.setAdjustViewBounds(true);
// set the ImageView bounds to match the Drawable's dimensions
RelativeLayout.LayoutParams params1 = new RelativeLayout.LayoutParams (LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
params1.addRule(RelativeLayout.ALIGN_PARENT_TOP); layout.addView(imageView1, params1);
ImageView imageView2 = new ImageView(this); imageView2.setImageResource(R.drawable.icon);
imageView2.setAdjustViewBounds(true); // set the ImageView bounds to match the Drawable's dimensions
RelativeLayout.LayoutParams params2 = new RelativeLayout.LayoutParams
(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
params2.addRule(RelativeLayout.RIGHT_OF, imageView1.getId());
layout.addView(imageView2, params2); this.setContentView(layout); }

Can anyone offer the Java equivalent to the above XML? Can anyone explain why there is no attribute, getter/setter, or method for accessing the properties that can be set in XML? What is the most elegant solution for dynamically creating Layouts, Views, and other Resources on the Android platform when there is no Java programmatic equivalent?

View 11 Replies View Related

Android :: How To Make Use Of Views Defined In Layout XML File As Template To Create Views Programmatic Way

Feb 28, 2010

I want to populate a table, defined in layout xml file through the programmatic way. I have define Table with a single row defining its header, with all the attributes set. Now i want to know a way so that i can just replicate that header row in the table with new content.

I tried using inflator inflate(int,view) method, but at runtime it showed up with error.

Here is the XML code for the layout file defining the table

CODE:.................

View 1 Replies View Related

Android :: Android Scrollbars In Programmatic Way

Jul 14, 2009

"android:scrollbars" are used in XML layout file to declare whether a view having scrollbar. I would like do it programmatic. according to api doc, there seems no direct peer method. Should I have to read a attr xml file? http://developer.android.com/reference/android/view/View.html

View 3 Replies View Related

Android :: Take Screenshot Programmatically

Aug 7, 2009

i have a requirement to place 2 overlapping image view inside a web view.the upper image view can be moved using trackball and the lower image view is static.now i want to capture the whole screen programmatically and save it as an image.i have referred this link but unable to get the solution.

View 2 Replies View Related

Android :: Screenshot Without SDK And Rooting

Apr 4, 2010

All I keep seeing is people asking for an app that allow screenshots without root. The only solution all have given is installing sdk which is a pain in the bum to do. I have another mini-solution until such an app is developed.

Both Open Home and Home++ have this feature built in. Only negative to it is, you won't be able to take a screenshot of your HTC Sense UI home screen or Android stock home screen only the open home or home++ screen. But for many who are like me and could not run the SDK correctly, this works just fine.

View 8 Replies View Related

Android : Screenshot Of Nexus One From Adb?

May 10, 2010

My goal is to be able to type a one word command and get a screenshot from a rooted Nexus One attached by USB. So far, I can get the framebuffer which I believe is a 32bit xRGB888 raw image by pulling it like this: adb pull /dev/graphics/fb0 fb0 rom there though, I'm having a hard time getting it converted to a png. I'm trying with ffmpeg like this: ffmpeg -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb8888 -s 480x800 -i fb0 -f image2 -vcodec png image.png That creates a lovely purple image that has parts that vaguely resemble the screen, but it's by no means a clean screenshot.

View 6 Replies View Related

Android :: Application's Layout Of Screenshot

Jul 16, 2009

this is a layout issue, now my app's layout is this screenshot...........

View 7 Replies View Related

Android :: Home++ Just Added Screenshot

Dec 13, 2009

If you miss CaptureIT from the BB days, or just wanting an easy way to take a screenshot and don't mind using Home++ well this afternoon the new release includes snapshot. It captures great and the colors are excellent.

View 6 Replies View Related

Android :: Screenshot Available With 2.2 Froyo Update?

Jul 29, 2010

Is screenshoting coming on the 2.2 Froyo update? Sorry if this has been talked about before just haven't seen anything about it.

View 12 Replies View Related

Android : How To Do We Take A Screenshot Using ADB Command Line

Aug 27, 2009

Read through Couple of articles , Most of them point to the DDMS through that we could take the Screenshot. However i am trying to capture the Emulator screen from the Command Line. Not Sure how to tweak the framebuffer /Surface flinger to do the job. or is there any app that we could run in the background and get the job done.

View 10 Replies View Related

Android : Is There An App That Takes A Screenshot Of My Phone?

Sep 8, 2009

I am looking for an app that will take a screenshot of what's currently on my screen. Or maybe somebody knows a better way for me to capture a screenshot from the phone. Any thoughts?

View 14 Replies View Related

Android : How Do You Capture A Screenshot Of Your Own App Programatically

Sep 29, 2010

I know you need root access if you want to capture a screenshot by using a background application. However is it possible to just grab the screen content of your current visible activity owned by your process? This does not seem like a security constraint since the user has already installed your app is currently using your app. If so how does this work?

View 2 Replies View Related

General :: Take Screenshot On Android Phone?

Apr 11, 2012

Rooting phone and probably installing some APKs just to take screenshot of any screen on Android phone. How to take screenshot on an Android Phone?

Ans -> Press power button (mostly present on top of phone) and keeping it pressed, quickly press "Home" touch key on front screen. That's it. That's all you needed to take screenshot. Image is saved in Gallery folder of your phone. This pretty much works in Gingerbread and ICS, if not other versions of Android.

View 8 Replies View Related

Android :: Is There A Way To Implement Screenshot Functionality In Phone?

Sep 10, 2010

Is there a way to implement screenshot functionality in phone?

View 12 Replies View Related

Android : Trying To Make DDMS Screenshot - Archos 5 IT

Nov 13, 2009

I'm trying to make a screenshot of an Archos 5 IT using DDMS (SDK 1.5 and 2.0) without success. The screenshot is awful with a lot of yellow. Do you have the same issue ? I would like to know if possible if this issue is due ti an SDK problem or an Archos problem.

View 2 Replies View Related

Sprint HTC Hero : Which Is Your Favorite Screenshot App For Android?

Sep 11, 2010

(Root Users only of course, unless your using Home++)I think I have tested them all out and I like "drocap2 for root users" the best; "Screenshot It" is nice but I can't stand the icon. Here are both the "Screenshot It' and "drocap2 for root users" icons in the status bar: 1. "Screenshot It" uses a green Android botwhile 2. "drocap2 for root users" uses a camera image Which Screenshot App do you use?

View 8 Replies View Related

Android : Why Do Screenshot Utilities Require Rooting?

Oct 18, 2009

Why do Android screenshot utilities only work on rooted devices? Linux distributions and desktop environments provide user-space screen capture tools. Why can't Android? I wonder what are the technical issues, if any, that prevent this. The only user-space procedure I am aware of, i.e. installing about 1 GB worth of development tools on a PC, hooking it to an Android device via USB, and disabling some of its funzionality (e.g. SD card access), is not user-friendly.

View 6 Replies View Related

Motorola : Taking Screenshot Of Android OpenGL

Jul 22, 2010

I'm fighting from some time with taking a screenshot of Android OpenGL.The code I found is as follows:In each case the result is a png file which is completely black. I found there is some problem with glReadPixels method but I don't know how to bypass it.

View 1 Replies View Related

Android :: Code For Capturing The Screenshot Of Live Wallpaper

Nov 16, 2010

I want to capture the screenshot of live wallpaper which is the current wallpaper in the launcher. Is there the method to capture the screenshot?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved