Android :: Namespaces And Custom Widgets
May 10, 2010
As a continuation of the thread in http://groups.google.com/group/android-developers /browse_thread/threa, I'm still trying to figure out how a custom widget can use getIdentifier() to read attributes. As an example, I have a widget class called Custom Widget. It has attributes "inner_margin" and "outer_margin". Normally, to read these attributes, I would do the following in source code: import com.example. customactivity. R;// I don't want to do this. TypedArray a = ctx.obtainStyledAttributes(attrs, R.styleable. CustomWidget); innerMargin = a.getInt(R.styleable.CustomWidget_inner_margin, 0); Because my CustomWidget is intended to be shared among a number of projects, or even get published, it's a real problem having to import R from whatever activity it's going to be linked with. What I'd rather do is: int resid = ctx.get Resources ().get Identifier ("inner_margin", "int", "com.example.customwidget"); innerMargin = a.getInt(resid, 0); but getidentifier always returns zero. Can anybody tell me the magic I need to perform to do what I want? For completeness, my CustomWidget.xml file that defines the resources looks like this: <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="CustomWidget"> <attr name="outer_margin" format="integer" /> <attr name=" inner_margin" format="integer" /> </declare-styleable> </resources> and for even more completeness, the entire source code can be found at http://www.efalk.org /tmp/ CustomWidget.tar.gz You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android
View 2 Replies
Apr 23, 2010
I'm trying to write an XML parser that takes an RSS feed & fetches the image urls shown in the url attribute of the <media:thumbnail> tag. This is all being done via android.Util.Xml, & is an adaptation of the code shown here. An example RSS feed that I'm trying to use is the BBC News RSS feed. However, media is an additional namespace & (probably) as a result my parser isn't working as it should. A version of my parse method is below. Is there any (no doubt simple) way to get my list of image URLs working?
..................
View 2 Replies
View Related
Feb 19, 2009
Is there any way to re-use the existing Widgets provided by the default Launcher in a custom Launcher application? At least without going into the main android source tree in order to use the internal classes?
View 5 Replies
View Related
Sep 27, 2009
Are widgets currently not supporting any type of custom components? I've tried creating a very simple custom TextView component and it does not work when displaying the widget... Also, can we use the animation classes in widgets?
View 4 Replies
View Related
Feb 18, 2009
Anyone know how to make a custom widget for the desktop like the google search, clock etc?
View 2 Replies
View Related
Mar 19, 2010
I created a custom view extending "android.view.View" class. Now in this class can I add a widget like button or image View.
View 3 Replies
View Related
Jul 29, 2009
I would like to create a widget that can reads its attributes from an XML file onCreate. I've created a Custom Button that extends Button widget. I would like to define its layout and styling in an XML, such that the widget can be reused across different views, with the same styling attributes. The notepad sample code does carry some pointers to this problem, however, it defines a XML layout with the component as View, inside LinearLayout, which is not really what I'm trying to achieve here.
View 4 Replies
View Related
Mar 28, 2012
I'm redoing my home screen, and I want to have a few text icons that take me directly to specific home screens. Apex launcher has action shortcuts for this, but they are only 1x1. I cannot use widgets to get these actions... I have to use shortcuts. I have done what I want with 1x1 shortcuts, but they are just too small for my taste. I really want 2x1 shortcuts. I have not been able to figure out how to make them with either Simple Text or Desktop Visualizer.
View 1 Replies
View Related
Nov 17, 2010
I'm trying to encapsulate certain layouts that I've made, to help me dry up my android xml ui files. I have the following code:<LinearLayout
android:id="@+id/LinearLayout02"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal">
<TextView style="@style/text_view_small"
android:id="@+id/time"></TextView>
<TextView
style="@style/text_view_small"
android:id="@+id/number_of_worlds">
</TextView> </LinearLayout>I want to simply convert it to the following <DoubleTextView></DoubleTextView> Once done I want to be able to use the "widgit" in other xml files.Are there any particular resources or examples that I can look at to help me figure out how to do this?
View 1 Replies
View Related
Oct 29, 2010
Change log states "Toggle widgets can be skinned".where is the option? I'm sure it's obvious, but I sure can't find it.
View 11 Replies
View Related
Dec 15, 2009
Was wondering if anyone has used both and if so, which one is better and why you think so.
View 13 Replies
View Related
Jun 7, 2010
I'm looking for widgets that could occupy my last screen.I have already used HTc stock widgets that I like, plus Astrid tasks widget and extended controls 1x4 widget.hopefully something functional, cool and/or interactive widgets that are 1x4, 2x4, 4x4 or any large one.
View 2 Replies
View Related
Jun 2, 2010
I'm new to Android application development and I'm currently experimenting with various UI ideas. In the image below, you can see a vertically scrolling list of horizontally scrolling galleries (and also textviews as you can see). I'm also doing some matrix and camera transformations which I will come to in a minute.
For the background of the list elements, I use green. Blue is the background of the galleries, and red is the background for the images. These are just for my benefit of learning.
The galleries being used are extended classes where I overrode the drawChild method to perform a canvas scale operation in order for the image closest to the center (width) to be larger than the others. The list view going vertically, I overrode the drawChild method and used the camera rotations from lack of depth dimension in the canvas functionality. The items in the list are scaled down and rotated relative to their position's proximity to the center (height).............
View 1 Replies
View Related
Oct 29, 2010
I have just got a new Galaxy S. Pressing the Menu key gives me an + button which when pressed gives me the option to add Samsung Widgets and Android Widgets.What're the differences between Samsung Widgets and Android Widgets?
View 1 Replies
View Related
Jun 18, 2010
I have seen examples implementing a custom Filter. The Android developer docs talk about implementing a Filterable interface. Does anyone have any advice and/or sample code on the best way to implement filtering in a ListView ?
View 2 Replies
View Related
May 3, 2009
I am writing a custom preference dialog derived from DialogPreference and I want to pass some custom attributes to the dialog through the preference's XML definition. Here's my preference.xml file:
CODE:...............
View 2 Replies
View Related
Mar 1, 2010
I am trying to get the images to have transparent backgrounds so the map is not blocked by a square marker with an image in it. What image editor and what settings should I use to get this to work?
I am trying to do some custom backgrounds for buttons and the same problem comes up: I get square corners and a background that does not scale with the buttons.
I think this all part of the same problem: I am not using the right tool with the right settings to create the images. I must be misinterpreting the documentation and examples that talk about a white border around the image and a black line along the top and left side for the expandable button background.
Here's a quick way to reproduce the problem:
Follow the directions to create the MapView program as described on:
http://developer.android.com/resources/tutorials/views/hello-mapview.html
For the icon I first used the image copied from the page:
Next I edited the picture in Microsoft Paint, and cut off the little guy's antennae. I'm not cruel and no real androids were harmed in that experiment. I surrounded the new picture with a pixel thick border of white, copied from the border that was around the rest of the image, and then copied the black that was there as well in the void areas of the image, outside the border.
I saved the image as myandroid.png and copied the file to the layout folder. Pointed the activity to the new pic and ran the program.
The image was displayed with a full square background and shadow, not the android shaped image and shadow that was there when the original image was used.
Custom Button background:
Follow the directions for the Relative Layout example at:
[url]
Next, I created an image to expand as a background for the button called backbutton.png. It too is surrounded by a white border and black filled on the corners, the top and one side per documentation I found in "Android Programming Tutorials" on page 298.
The background does not expand, nor do the corners round.
I wish I could show you screenies of what I have.
How do you create the images for the custom backgrounds and the images for the custom map markers and buttons? I need to know what image editor to use and the file attributes to set, so the images expand and display with the proper void spaces in them.
View 2 Replies
View Related
Sep 18, 2009
I try to implement a custom button(OnPressButton), and the code is in below. In LogCat, I can see the two parameters (btn_up/btn_down) value are below:
btn_up=@drawable/btn_up btn_down=@drawable/btn_up
But how can I convert this to point to R.drowable.btn_up and R.drowable.btn_down ?
CODE:....................
View 2 Replies
View Related
Jul 8, 2009
I'm creating my own View class, and defining custom xml attributes with a attrs.xml. As long as I provide each attribute manually, there is no problem, but
code:...................
The android:text is properly set in my instance, but the borderDrawable is not. I guess this has something to do with namespaces, because inside the styles.xml, the name="mypack:borderDrawable" is not handled by the XML parser's namespace facility, because its inside an attribute value. So "mypack" is in no way connected to "http://some.weird.url.com/seems/not/to/ matter" and adding it via xmlns:mypack... to the stylefile would not help, I guess. In the same file, "android:text" is somehow recognized, even though "android" is AFAIK only a ns-defintion for [url], which is also not declared in that file.
So what is the proper way to set a custom attribute in a style?
View 3 Replies
View Related
Feb 21, 2014
I just went through the process of compiling a custom ROM and they used a stock kernel. I would like to incorporate a different kernel when I compile and instead of the stock. I know I could compile them separately and have them flash together but I want one zip to flash. Just would like to go through the process to learn.
what I have to do when compiling?'
View 9 Replies
View Related
Sep 20, 2009
I'm developing a Widget that updates every 10 seconds (android:updatePeriodMillis="10000"). On the 1.5 emulator, as well as on my adp1, it works as expected. On the 1.6 emulator, my widgets are not updated. Apparently, AppWidgetProvider.onUpdate(...) is never called.
View 16 Replies
View Related
May 15, 2010
How many widgets do you have on your home screens Im using ADW launcher now (just started) and im hoping it will run my 14 widgets on 5 screens Helix 2 couldnt handle the pressure :PHow many do you guys have running at one time?
View 12 Replies
View Related
May 29, 2010
I love sense but also am trying out adw launcher. Is there any other good bookmark widgets out there. That is the one widget I can not live without. Everyone one I have tried has been pretty terrible. Any suggestions for the incredible?
View 8 Replies
View Related
Jan 8, 2010
I'm having no problems now about the weather or time being wrong. So to those who didn't like it because of the bugs, here's your second chance!
View 1 Replies
View Related
May 27, 2010
Having seen so many people posting images of their home screens, I have come to the conclusion that I must be the only person to hardly use widgets! I have two - Calendar Pad (1x1) which shows me todays date and when I click it it takes me direct to my week view, and the Power Bar to turn off WiFi, GPS, etc. I've tried things like Face book, Twitter, News, etc, and just get frustrated as they don't really display enough. Maybe I've just not found the RIGHT widgets yet, but I fear I may be missing out on something!
View 14 Replies
View Related
Jun 22, 2010
I recently got a custom ROM running on my amazing G1, but I would like some more widgets, like some of the ones on the HTC Hero, such as the messages Widget etc.Is there one like that that is on the Android Market?If not, what are the best downloadable widgets?
View 2 Replies
View Related
Dec 16, 2009
I sent HTC a E-mail regarding them taking it down, and this is what the sent back.I am sorry about any inconvenience that this has caused you. The Beautiful Widgets Application was probably removed from the Android Market because of coding errors. I would suggest contacting the developer of the application. There may be other applications on the Android Market that are similar to this application. HTC does not have control of what is removed from the market. You would need to contact someone from android.com, because they are the developers and they would be the ones to flag programs from the site.
View 49 Replies
View Related
Oct 22, 2009
I currently use Launcher Dock but it is laggy and only holds 8 apps. It would be nice to have something along the lines of stack for iPhone OS (jailbroken of course ), seamless transition between icon and page of specified apps.
View 19 Replies
View Related
Mar 29, 2010
Was wondering if I would have to have my GPS turned on for it to work properly? Or, could I use it with GPS off with it being able to work OK with network based locations? I ask because I usually keep my GPS off to conserve battery power.
View 9 Replies
View Related
Oct 28, 2010
I've downloaded some widgets on my Evo 4g and would like to delete them but cant quite figure out how....
View 1 Replies
View Related