[android-developers] Android widget layout doesn't change after rotation

2013-04-26 Thread zhiyazw


See the layout xml:

LinearLayout xmlns:tools=http://schemas.android.com/tools;
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=vertical
tools:context=.MainActivity xmlns:android=
http://schemas.android.com/apk/res/android;

TextView
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_gravity=center_horizontal
android:layout_marginBottom=10dp
android:layout_marginTop=10dp
android:text=Temperature Chart
android:textAppearance=?android:attr/textAppearanceLarge /

LinearLayout
android:id=@+id/chartContainer
android:layout_width=match_parent
android:layout_height=wrap_content 

TextView
android:id=@+id/textTemperature
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_gravity=center_vertical
android:transformPivotX=0sp
android:translationY=0sp
android:rotation=-90
android:text=Temperature /

/LinearLayout
/LinearLayout
 
then I insert a chart view into the chartContainer LinearLayout. The 
executing result is as the following picture:
you can see the problem is, after textTemperature is rotated, it still 
occupy the room as before it rotated, bellow layout view confirmed this.

https://lh4.googleusercontent.com/-qw0ryGAA_6A/UXo1t4C2RjI/AA8/Buvso--p66I/s1600/chart1.png


My question is how can I make the textTemperature widget only occupy the 
width as it is looked like? that's, there is no additional blank between 
textTemperature and the chart.
I know writing a customized widget or putting the rotated widget in an 
individual FrameLayout could accomplish this, I mean to seek there is any 
lighter way, such as a property, etc.

 

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Android Widget: Custom analog clock

2013-04-23 Thread Resurrcting the champ
Please check out one of these projects.

https://custom-analog-clock.googlecode.com/svn/trunk/

https://github.com/MadyZaid/Android-widget-Custom-Analog-Clock.git

Please help me make this code better

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Android widget: dinamically list from own combiled string (as template)

2012-02-29 Thread Stan Prihodko
HI,

I'm now develop my first widget (not application) and I want to generate 
dynamically strings, there each string should be as: 
image(left)+text(left)+text(right).
I has been prepared this string in layout,  and I want to use my 
template-string as template to generate all strings a few times, as list. 
But I can't understood how it do.

Could you please explain how do correct my idea? 
(Or may be key words to search in google...)

Thanks.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Android widget: dinamically list from own combiled string (as template)

2012-02-29 Thread TreKing
On Wed, Feb 29, 2012 at 6:40 AM, Stan Prihodko stas.priho...@gmail.comwrote:

 Could you please explain how do correct my idea?


Your idea is not very clear. You should try to clarify.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Android Widget: java.lang.NullPointerException

2012-01-13 Thread myzinsky
Hi,
I wrote an Android widget with alarmmanager as updating process.
Sometimes i've got a nullpointer exception. But all objects are
initialized...

public void UpdateWidget(Context con)
{
//Log.d(berlinClock, UpdateWidget=+i);
RemoteViews views=new
RemoteViews(con.getPackageName(),R.layout.widgetlayout);
Calendar c = Calendar.getInstance();
int h = c.get(Calendar.HOUR_OF_DAY);
int m = c.get(Calendar.MINUTE);

ComponentName thisWidget = new ComponentName(con,widget.class);

//update views on remoteView
// GOT NULLPOINTER EXEPTION IN FOLLOWING LINE (96)
views.setImageViewResource(R.id.wha1, R.drawable.cgrau);
views.setImageViewResource(R.id.wha2, R.drawable.cgrau);
...
}

Here is the Stacktrace:

java.lang.RuntimeException: Unable to start receiver
ms.jung.android.berlinclock.widget: java.lang.NullPointerException
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2821)
at android.app.ActivityThread.access$3200(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
2083)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at ms.jung.android.berlinclock.widget.UpdateWidget(widget.java:96)
at ms.jung.android.berlinclock.widget.onReceive(widget.java:34)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2810)

have you any ideas?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android Widget with AlarmManager and Configuration

2011-12-08 Thread Bhavin
I want a widget that have a configuration activity, which asks some
information to user. Once the information is provided by user I want
my widget to be updated every 10 minutes. So I need an Alarm Manager.
On every 10 minutes my widget fetches some data from my website and
displays it on widget, for that I can use service.

From many days I am trying to implement this. I googled a lot, but
failed while putting all these together. I can implement alarm manager
separately, I can implement services separately, I can use
configuration activity separately. But when I put all these in a
single project I get lots of error.

Can anyone please refer me any document or example that may help me?
Regards,
Bhavin Mistry.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Android Widget with AlarmManager and Configuration

2011-12-08 Thread TreKing
On Thu, Dec 8, 2011 at 12:09 PM, Bhavin likebit@gmail.com wrote:

 But when I put all these in a single project I get lots of error.


Why don't you explain what your lots of error are and maybe someone can
help?

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Android Widget update problem

2011-09-26 Thread Plabon Modak
Hi,

I have made a android widget for my application. I have used a
layout(linear) in the xml of the widget. There is a textview showing some
text in that layout.

Now i want to change the text of the textview on tapping or clicking the
layout. Can any one help me to do that.

Thanks,
RawCoder

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Android Widget update problem

2011-09-26 Thread tamil maran
write the onclick event for layout ,and inside of click event we can set the
text

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Android Widget update problem

2011-09-26 Thread Plabon Modak
But there is only views.setOnClickPendingIntent(R.id.tipslayout,
actionPendingIntent); this method for widget.

I didnot get any setonclicklistener(). Can u please provide an example code
for me?

On Mon, Sep 26, 2011 at 6:19 PM, tamil maran tam.mara...@gmail.com wrote:

 write the onclick event for layout ,and inside of click event we can set
 the text


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Android Widget update problem

2011-09-26 Thread Ash McConnell
You need to create a pending intent which will send an event to your widget, 
then handle that event in your widget

Intent intent = new Intent(context, MightyToggleWidget.class);
intent.setAction(MY_HANDLE_BUTTON_EVENT_NAME);

PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 
0);
views.setOnClickPendingIntent(button, pendingIntent);

This will make the MY_HANDLE_BUTTON_EVENT_NAME event to be broadcast.   

Now you need to handle this event in your AppWidgetProvider implementation

...To do this you need to tell Android O/S that your AppWidgetProvider will 
handle the event, you do this by adding an entry in the intent-filter 
section like so:-

action android:name=MY_HANDLE_BUTTON_EVENT_NAME /

Now you need to actually handle the event.  You need to override 
AppWidgetProvider's onReceive like so: -

@Override
public void onReceive(Context context, Intent intent) {
super.onReceive(context, intent);

 if 
(intent.getAction().equals(MY_HANDLE_BUTTON_EVENT_NAME){
doSomething();
 }
}

I hope this helps!
All the best,
Ash

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Android Widget multiple instance problem?

2011-07-30 Thread shubh
I am creating an chat widget in which  I starting Service class thread
as I create instance (onUpdate of AppWidgetProvider) , so every time
when I create new instance my onUpdate call and service started
again...
so let me know How can I update all instance using single service
instance.

thanks

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android Widget onActive()

2011-07-13 Thread cathal coffey
Hi Guys,

I've created a Widget and I would like to do something every time it
is on screen.
By on screen, I mean if the user moves to a screen that contains this
widget. I want it to fire something like the below function.

@override
public void onActive(Context context, Intent intent)
{
// Your widget is visible, do something.
}

Is there a function like this in the Android SDK? The Android clock
widgets seems to function like this, whenever the user moves to a
screen that has an Andorid clock Widget, it updates it's display to
show the current time.

Kind regards,
Cathal

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Android Widget onActive()

2011-07-13 Thread Mark Murphy
On Tue, Jul 12, 2011 at 4:46 PM, cathal coffey coffey.cat...@gmail.com wrote:
 I've created a Widget and I would like to do something every time it
 is on screen.
 By on screen, I mean if the user moves to a screen that contains this
 widget. I want it to fire something like the below function.

 @override
 public void onActive(Context context, Intent intent)
 {
    // Your widget is visible, do something.
 }

 Is there a function like this in the Android SDK?

No.

 The Android clock
 widgets seems to function like this, whenever the user moves to a
 screen that has an Andorid clock Widget, it updates it's display to
 show the current time.

That's not an app widget.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in London: http://bit.ly/smand1, http://bit.ly/smand2

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] android widget

2011-07-12 Thread Justin Anderson
What does logcat say?

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Tue, Jul 5, 2011 at 4:11 AM, yanamala siddaiah siddaiahforj...@gmail.com
 wrote:

 onclick in emulator  button is working. but in device it shows null
 pointer exception .

 ontuch event and it shows some line number textview 2332

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] android widget

2011-07-05 Thread yanamala siddaiah
onclick in emulator  button is working. but in device it shows null
pointer exception .

ontuch event and it shows some line number textview 2332

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android widget--table display

2011-04-28 Thread Niall
Hi all,

I have an android widget that scraps information from a website. I
want to display the data that I have gotten in a table form that's
shown on my widget, but I don't know how. I have tried the following
(but they don't appear to work)...

First I tried adding in a table in my widget, but this isn't allowed,
I think due to the limitations of RemoteViews.
The next approach was to use a TextView and importing Html and I tried
to make a table, but this isn't allowed either. I can get a table-
esque layout, but it is not satisfactory.
The third thing I tried involved making a nested list of
LinearLayout's, but this didn't work either. It was here that I found
out about the limitations of the thing.

There will always be 6 rows but there will be an indeterminate number
of columns.

I'm all out of ideas about how I might get around this problem. Does
anyone here know how I might solve this problem?

Thanks

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android Widget Design.

2011-04-26 Thread Chris Ruskai
Hi, I've been programming apps for a while now and want to branch out
into the realm of widgets. Does anyone have any suggestions on where
to find good tutorials? I've googled the subject and my results are
limited to maybe one or two specific widgets. What I'm looking for is
more of a general tutorial.

Thank you,
Chris Ruskai

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Android Widget Design.

2011-04-26 Thread Satya Komatineni
Chris,

I don't have an online tutorial but we have covered this topic in a
fair amount of detail in our 2nd edition of ProAndroid 2
(http://www.androidbook.com) from Apress. The coverage includes state
management through preferences.

The third edition that should be available any time soon have extended
the material to also cover list based widgets in honeycomb.

Here is my journal as I have developed material for those chapters.

http://www.satyakomatineni.com/item/3299

Hope this will be of some help. the journal is useful if you are
looking for answers to specific questions but if you are looking for a
tutorial the book is much more helpful

Thanks
Satya Komatineni
http://www.satyakomatineni.com
http://www.androidbook.com

On Mon, Apr 25, 2011 at 3:49 PM, Chris Ruskai cruskai...@gmail.com wrote:
 Hi, I've been programming apps for a while now and want to branch out
 into the realm of widgets. Does anyone have any suggestions on where
 to find good tutorials? I've googled the subject and my results are
 limited to maybe one or two specific widgets. What I'm looking for is
 more of a general tutorial.

 Thank you,
 Chris Ruskai

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Android Widget Design.

2011-04-26 Thread Nikolay Elenkov
On Tue, Apr 26, 2011 at 4:49 AM, Chris Ruskai cruskai...@gmail.com wrote:
 Hi, I've been programming apps for a while now and want to branch out
 into the realm of widgets. Does anyone have any suggestions on where
 to find good tutorials? I've googled the subject and my results are
 limited to maybe one or two specific widgets. What I'm looking for is
 more of a general tutorial.


This has all you need. Along with *real*, not 'hello world'-grade code.

http://code.google.com/p/android-sky/

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android widget eBook

2011-04-15 Thread Aungswee
The essential guide to Android widgets, an eBook featuring the top
ten Android widgets from various categories provides practical
information about widgets to help you choose the best widgets for your
device. http://www.smashwords.com/books/view/49216

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android Widget Binder Transaction

2011-02-03 Thread Wolfman Khan
Hi Fellow Developers,

I've been trying to work on a simple clock widget using my own images
etc. It works perfectly using the emulator. I've tested it on the 2.1
Update 1 emulator, 2.2 emulator and 2.3 emulator. However, when i try
to run it on my phone (HTC Desire, running 2.2) the widget never shows
up and looking at the logcat all I see is !! FAILED BINDER
TRANSACTION !! over and over again, until i 'remove' the widget, even
though there is nothing to see there.
Anyone have any idea why my widget might work in the emulator but not
on an actual phone?
Please help.

Cheers

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android: widget App

2010-12-03 Thread Ramesh M
Hi,
  Can any one have code for Cricket scorecard widget application..

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android Widget

2010-09-30 Thread yenpei
Hi,

When I add a widget, there always the widget label name let's say
Weather widget with HTC as the provider in 2 lines.

How do I add the creator of the widget like HTC. All my current
widget are showing Android as provider. Can we change it to some
other name?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Android Widget

2010-09-30 Thread Mark Murphy
On Thu, Sep 30, 2010 at 12:34 PM, yenpei yen...@gmail.com wrote:
 When I add a widget, there always the widget label name let's say
 Weather widget with HTC as the provider in 2 lines.

That is a feature of HTC Sense. It does not work that way on all phones.

 How do I add the creator of the widget like HTC. All my current
 widget are showing Android as provider. Can we change it to some
 other name?

I am not aware that HTC has documented any way to specify this. My
guess is that they are simply distinguishing between ones they created
and other ones from elsewhere. Earlier versions of Sense had those in
separate groups rather than intermingled.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en