[android-developers] Separating Widget from main Application

2009-07-30 Thread rycerz1411

Hello,
I have a existing application and I added a Widget to it, so now I
have app and widget in this same apk.
When I launch the main app the widget onUpdate gets executes whitch is
not what I want  is there any way to separate this two.
--~--~-~--~~~---~--~~
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] Re: Separating Widget from main Application

2009-07-30 Thread rycerz1411

It does only happen from Eclipse a, but I am not sure if this behavior
would be identical when someones installs the app and launches it the
first time.

Thanks

On Jul 30, 11:31 am, Michael Elsdörfer mich...@elsdoerfer.info
wrote:
 Make sure this doesn't just happen when you launch from Eclipse - this
 is actually a pretty useful feature for development.

 Michael
--~--~-~--~~~---~--~~
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] Re: Distinguishing Between Edge and 3G network

2009-03-05 Thread rycerz1411

Well I created a workaround for this, by testing network download
speed.
Here is a link to the source code
a href=http://www.gregbugaj.com/?p=47;Source/a

This is not perfect but it works, maybe they are using one of their
internal packages that are not available via SDK.


On Mar 2, 1:39 pm, rycerz1411 gregbugaj1...@gmail.com wrote:
 That's exactly what I have tried

        ConnectivityManager c=(ConnectivityManager) getSystemService
 (Context.CONNECTIVITY_SERVICE);
         Log.i(TAG, c.getActiveNetworkInfo()=+c.getActiveNetworkInfo
 ());
         NetworkInfo info=c.getActiveNetworkInfo();
         Log.i(TAG,info.getTypeName()=+info.getTypeName());

 One would expect that there would be a reliable way to do this.
 Maybe checking the speed of connection would give me any idea what
 they are using ?

 Thanks

 On Mar 2, 1:22 pm, Kather Jailani jail...@gmail.com wrote:

  Try getActiveNetworkInfo or getNetwokInfo methods

  On Mar 2, 2009 3:13 PM, rycerz1411 gregbugaj1...@gmail.com wrote:

  Is there a way to distinguish between Edge and 3G network?
  I have looked at the ConnectivityManager getType method but all it
  returns is MOBILE or WI_FI.
  For 3G i want to show user different UI that I do for an Edge

  Anyone have any suggestions.

  Greg
--~--~-~--~~~---~--~~
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] Distinguishing Between Edge and 3G network

2009-03-02 Thread rycerz1411

Is there a way to distinguish between Edge and 3G network?
I have looked at the ConnectivityManager getType method but all it
returns is MOBILE or WI_FI.
For 3G i want to show user different UI that I do for an Edge


Anyone have any suggestions.

Greg
--~--~-~--~~~---~--~~
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] Re: Distinguishing Between Edge and 3G network

2009-03-02 Thread rycerz1411

That's exactly what I have tried

   ConnectivityManager c=(ConnectivityManager) getSystemService
(Context.CONNECTIVITY_SERVICE);
Log.i(TAG, c.getActiveNetworkInfo()=+c.getActiveNetworkInfo
());
NetworkInfo info=c.getActiveNetworkInfo();
Log.i(TAG,info.getTypeName()=+info.getTypeName());


One would expect that there would be a reliable way to do this.
Maybe checking the speed of connection would give me any idea what
they are using ?

Thanks

On Mar 2, 1:22 pm, Kather Jailani jail...@gmail.com wrote:
 Try getActiveNetworkInfo or getNetwokInfo methods

 On Mar 2, 2009 3:13 PM, rycerz1411 gregbugaj1...@gmail.com wrote:

 Is there a way to distinguish between Edge and 3G network?
 I have looked at the ConnectivityManager getType method but all it
 returns is MOBILE or WI_FI.
 For 3G i want to show user different UI that I do for an Edge

 Anyone have any suggestions.

 Greg
--~--~-~--~~~---~--~~
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] Possible bug in TableLayout

2009-02-16 Thread rycerz1411

I think that there is possible bug in TableLayout SDK 1.0 rc2 when
constructing table from code. It seams that the weight  or height
attribute is not respected when rendering the layout.

The XML view creates a table with row at the top and row at the bottom
of the screen  which is what supposed to happen, so I created this
same table via code but the results are not what were expected. Maybe
I am missing something but it seams OK, all LayoutParams  are this
same.


Sample Code
[code]
private View buildTableViewFromSource(){
TableRow.LayoutParams pTable=new TableRow.LayoutParams
(TableRow.LayoutParams.FILL_PARENT,
TableRow.LayoutParams.FILL_PARENT);

TableLayout table = new TableLayout(context);
table.setBackgroundColor(Color.RED);
table.setLayoutParams(pTable);


TableRow rowTop = new TableRow(context);

TableRow.LayoutParams pRowTop=new TableRow.LayoutParams
(TableRow.LayoutParams.FILL_PARENT,
TableRow.LayoutParams.FILL_PARENT);
pRowTop.height=TableRow.LayoutParams.FILL_PARENT;
pRowTop.width=TableRow.LayoutParams.FILL_PARENT;
pRowTop.weight=1;

rowTop.setBackgroundColor(Color.BLUE);

TextView txt=new TextView(context);
txt.setText(Top Content);

rowTop.addView(txt, pRowTop);

TableRow rowBottom=new TableRow(context);
rowBottom.setBackgroundColor(Color.GREEN);

TextView txtBottom=new TextView(context);
txtBottom.setText(Bottom Content);

TableRow.LayoutParams pRowBottom=new TableRow.LayoutParams
(TableRow.LayoutParams.WRAP_CONTENT,
TableRow.LayoutParams.WRAP_CONTENT);
pRowBottom.height=TableRow.LayoutParams.WRAP_CONTENT;
pRowBottom.width=TableRow.LayoutParams.FILL_PARENT;
pRowBottom.weight=0;

rowBottom.addView(txtBottom);

table.addView(rowTop, pRowTop);
table.addView(rowBottom, pRowBottom);

return table;
}


private View buildTableViewFromXML(){
LayoutInflater inflater=(LayoutInflater) getSystemService
(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout layout=(LinearLayout) 
inflater.inflate(R.layout.table,
null);
TableLayout table=(TableLayout) layout.findViewById
(R.id.tableBottomLayout);
layout.removeView(table);

TableRow rowContent=(TableRow)table.findViewById(R.id.rowTop);

TextView txt=new TextView(context);
txt.setText(Top Content);
rowContent.addView(txt);

TableRow rowTabs=(TableRow)table.findViewById(R.id.rowBottom);


TextView txtBottom=new TextView(context);
txtBottom.setText(Bottom Content);
rowTabs.addView(txtBottom);

return table;
}
[code]

[code]
?xml version=1.0 encoding=utf-8?

TableLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:layout_height=fill_parent
android:id=@+id/tableBottomLayout

TableRow android:id=@+id/rowTop
android:layout_width=wrap_content android:layout_weight=1
android:layout_height=fill_parent

/TableRow

TableRow android:id=@+id/rowBottom
android:layout_width=wrap_content
android:layout_height=wrap_content android:layout_weight=0
!--
TextView android:id=@+id/TextView01
android:layout_width=wrap_content
android:layout_height=wrap_content android:text=HEllo/TextView
--
/TableRow

/TableLayout
[code]

Any suggestions , if anyone else can confirm this I will post this as
a bug.

Thanks
Greg
--~--~-~--~~~---~--~~
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] Re: Possible bug in TableLayout

2009-02-16 Thread rycerz1411

Thanks that's awesome. I knew I was doing something wrong
Quick question whay are you using FrameLayout for the Table?

Thanks Greg



On Feb 16, 7:57 pm, Romain Guy romain...@google.com wrote:
 Your code is *NOT* equivalent to the XML. You are using the wrong
 LayoutParams everywhere. A widget must have the LayoutParams of its
 *parent*. Therefore, the rows must have TableLayout.LayoutParams, the
 TextViews must have TableRow.LayoutParams and the TableLayout must
 have FrameLayout.LayoutParams.

 Here is your code, corrected, and it works just fine.

 package com.test;

 import android.app.Activity;
 import android.graphics.Color;
 import android.os.Bundle;
 import android.view.View;
 import android.widget.FrameLayout;
 import android.widget.TableLayout;
 import android.widget.TableRow;
 import android.widget.TextView;

 public class Test extends Activity {
         /** Called when the activity is first created. */
         @Override
         public void onCreate(Bundle savedInstanceState) {
                 super.onCreate(savedInstanceState);
                 setContentView(buildTableViewFromSource());
         }

         private View buildTableViewFromSource() {
                 FrameLayout.LayoutParams pTable = new 
 FrameLayout.LayoutParams(
                                 TableRow.LayoutParams.FILL_PARENT,
                                 TableRow.LayoutParams.FILL_PARENT);

                 TableLayout table = new TableLayout(this);
                 table.setBackgroundColor(Color.RED);
                 table.setLayoutParams(pTable);

                 TableRow rowTop = new TableRow(this);

                 TableLayout.LayoutParams pRowTop = new 
 TableLayout.LayoutParams(
                                 TableLayout.LayoutParams.FILL_PARENT,
                                 TableLayout.LayoutParams.WRAP_CONTENT);
                 pRowTop.weight = 1;

                 rowTop.setBackgroundColor(Color.BLUE);

                 TextView txt = new TextView(this);
                 txt.setText(Top Content);

                 rowTop.addView(txt, new TableRow.LayoutParams(
                                 TableRow.LayoutParams.FILL_PARENT,
                                 TableRow.LayoutParams.WRAP_CONTENT));

                 TableRow rowBottom = new TableRow(this);
                 rowBottom.setBackgroundColor(Color.GREEN);

                 TextView txtBottom = new TextView(this);
                 txtBottom.setText(Bottom Content);

                 TableLayout.LayoutParams pRowBottom = new 
 TableLayout.LayoutParams(
                                 TableLayout.LayoutParams.WRAP_CONTENT,
                                 TableLayout.LayoutParams.WRAP_CONTENT);

                 rowBottom.addView(txtBottom, new TableRow.LayoutParams(
                                 TableRow.LayoutParams.FILL_PARENT,
                                 TableRow.LayoutParams.WRAP_CONTENT));

                 table.addView(rowTop, pRowTop);
                 table.addView(rowBottom, pRowBottom);

                 return table;
         }

 }

 --
 Romain Guy
 Android framework engineer
 romain...@android.com

 Note: please don't send private questions to me, as I don't have time
 to provide private support.  All such questions should be posted on
 public forums, where I and others can see and answer them
--~--~-~--~~~---~--~~
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] Re: Any way to reject a call programmatically

2009-01-29 Thread rycerz1411

Can you post code for part A
I was trying to use IntentReciver but there is no way to reject the
call from there
NowI am trying to use reflections to get access to the underlying
functionality of the Phone API from

//String className=com.android.internal.telephony.CallerInfo;
//String className=com.android.internal.telephony.gsm.GSMPhone;
//String className=com.android.internal.telephony.PhoneFactory;

So far so good I post it here if I get it working.

On Dec 8 2008, 12:26 pm, Jay-andro jayan...@gmail.com wrote:
 Is there any direct (or convoluted) way torejectan incomingcall,
 i.e. send it directly to voicemail. Meaning
 (a) if acallis coming in and matches certain criteria
 (b) send thecallto VM, and stop the ringing. (programmatically)
 I've got (a) under control but I dont know how to do (b).
 Any ideas?
 Thanks
 Jay

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---