[android-developers] Chances of TELEPHONY_SERVICE return null

2012-10-24 Thread thejaswi s
Is there any chances of getting TELEPHONY_SERVICE as null ?

TelephonyManager teleman = (TelephonyManager) getBaseContext()
.getSystemService(Context.TELEPHONY_SERVICE);

I mean is there any chances of getting teleman as null in the above line ?

Thanks in advance for reply.

-- 
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] java.lang.NullPointerException and Unknown Source

2012-10-21 Thread thejaswi s
In my code I am getting this error. I pasted full log cat
java.lang.RuntimeException: Unable to start activity
java.lang.RuntimeException: Unable to start activity ComponentInfo{
sa.app.activity.EmailRegistartion}:
java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(
ActivityThread.java:1970)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
at android.app.ActivityThread.access$600(ActivityThread.java:128)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4514)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(
ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at sa.appoptix.com.activity.EmailRegistartion.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(
Instrumentation.java:1053)
at android.app.ActivityThread.performLaunchActivity(
ActivityThread.java:1934)
... 11 more


My oncreate metode contains following code

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.registration);

/* To calculate uId in email sending path */
TelephonyManager teleman = (TelephonyManager) getBaseContext()
.getSystemService(Context.TELEPHONY_SERVICE);
sws = new SaWebService();
deviceId = teleman.getDeviceId();
uId = deviceInfo();

re = RegisteredEmail.getInstance(this);
prefs = getApplicationContext().getSharedPreferences("email_id",
MODE_PRIVATE);

btn = (Button) findViewById(R.id.email_submit);
new_reg = (Button) findViewById(R.id.newuser_signup);
new_reg.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent viewIntent = new Intent(
"android.intent.action.VIEW",

Uri.parse("http://panel.strategyanalytics.com/default.aspx?mod=registrationfull";));
startActivity(viewIntent);
}
});

email = (EditText) findViewById(R.id.email);
email.setOnFocusChangeListener(new OnFocusChangeListener() {
public void onFocusChange(View v, boolean hasFocus) {
email.setHint("");
}
});

btn.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
email = (EditText) findViewById(R.id.email);
emailStr = email.getText().toString();
new AddTask().execute();
setContentView(R.layout.main);
email.setText("");

}
});
}


Help me out where I am going wrong. Thanks for help in advance.


Thanks,

Thejaswi

-- 
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] Call Graph in Android

2012-09-23 Thread thejaswi s
can please suggest few.


On Mon, Sep 24, 2012 at 11:34 AM, Kristopher Micinski <
krismicin...@gmail.com> wrote:

> this has nothing to do with Android...
>
> That said, many common Java analysis tools will generate call graphs.
>
> kris
>
> On Mon, Sep 24, 2012 at 1:59 AM, thejaswi s  wrote:
> > What are possible tools to generate the call graph of an android
> application
> > in eclipse? I would like to know which method calls which method. but i
> > can't seem to find anything helpful. I have read something about Oprofile
> > but many persons said that it is not working and contains many problems.
> i
> > would like to have the call graph of the application...like which class
> is
> > calling which..and so on..thank u.
> >
> >
> >
> >
> > Regards
> > Thejaswi S
> >
> > --
> > 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
>

-- 
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] Call Graph in Android

2012-09-23 Thread thejaswi s
What are possible tools to generate the call graph of an android
application in eclipse? I would like to know which method calls which
method. but i can't seem to find anything helpful. I have read something
about Oprofile but many persons said that it is not working and contains
many problems. i would like to have the call graph of the
application...like which class is calling which..and so on..thank u.




Regards
Thejaswi S

-- 
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] How to put outline for a gridview(or table view) boxes in android

2012-09-15 Thread thejaswi s
In my application I want a 5x5 grid view(or table view). I do not want to
use image view or text view in side the grid view(or table view).

   1. I just want to put out lines for the cells in side that grid view. Is
   it possible and how can I do it?
   2. I also want to take identity of individual cells inside the grid view
   (or table view)?

Thanks for your answers.

-- 
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] How to generate random numbers between 1 to 8?

2012-08-30 Thread thejaswi s
ya, thanks. I got.


On Thu, Aug 30, 2012 at 5:05 PM, Parthi K  wrote:

> in java support random method call random object .
>
> On Thu, Aug 30, 2012 at 3:43 PM, thejaswi s  wrote:
>
>> In my application I want to generate random number between 1 to 8 and
>> there should not be 5,6 and 7. i.e. random numbers must be (1, 2, 3, 4, 8).
>> 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
>
>
>  --
> 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] How to generate random numbers between 1 to 8?

2012-08-30 Thread thejaswi s
In my application I want to generate random number between 1 to 8 and there
should not be 5,6 and 7. i.e. random numbers must be (1, 2, 3, 4, 8).
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] Re: Don't understand the constants provided in powertutor

2012-08-27 Thread thejaswi s
Following methods are in dreamConstants file. From where they got these
constants? From which file they read it?

public double wifiHighPower() {
return 720;
  }

  public double wifiLowHighTransition() {
return 15;
  }

  public double wifiHighLowTransition() {
return 8;
  }

  private static final double[] arrayWifiLinkRatios = {
47.122645, 46.354821, 43.667437, 43.283525, 40.980053, 39.44422,
38.676581,
34.069637, 29.462693, 20.248805, 11.034917, 6.427122
  };

  private static final double[] arrayWifiLinkSpeeds = {
1, 2, 5.5, 6, 9, 11, 12, 18, 24, 36, 48, 54
  };

On Tue, Aug 28, 2012 at 12:59 AM, bob  wrote:

>
> Like this?
>
>
>
> /* Uids as listed in android_filesystem_config.h */
>   public static final int AID_ALL =   -1; /* A special constant we
> will
>* use to indicate a
> request
>* for global
> information. */
>   public static final int AID_ROOT=0; /* traditional unix root
> user
>*/
>   public static final int AID_SYSTEM  = 1000; /* system server */
>   public static final int AID_RADIO   = 1001; /* telephony subsystem,
> RIL */
>   public static final int AID_BLUETOOTH   = 1002; /* bluetooth subsystem */
>   public static final int AID_GRAPHICS= 1003; /* graphics devices */
>   public static final int AID_INPUT   = 1004; /* input devices */
>   public static final int AID_AUDIO   = 1005; /* audio devices */
>   public static final int AID_CAMERA  = 1006; /* camera devices */
>   public static final int AID_LOG = 1007; /* log devices */
>   public static final int AID_COMPASS = 1008; /* compass device */
>   public static final int AID_MOUNT   = 1009; /* mountd socket */
>   public static final int AID_WIFI= 1010; /* wifi subsystem */
>   public static final int AID_ADB = 1011; /* android debug bridge
>  (adbd) */
>   public static final int AID_INSTALL = 1012; /* group for installing
>  packages */
>   public static final int AID_MEDIA   = 1013; /* mediaserver process */
>   public static final int AID_DHCP= 1014; /* dhcp client */
>   public static final int AID_SHELL   = 2000; /* adb and debug shell
> user */
>   public static final int AID_CACHE   = 2001; /* cache access */
>   public static final int AID_DIAG= 2002; /* access to diagnostic
>  resources */
>   /* The 3000 series are intended for use as supplemental group id's only.
>* They indicate special Android capabilities that the kernel is aware
> of. */
>   public static final int AID_NET_BT_ADMIN= 3001; /* bluetooth: create any
>  socket */
>   public static final int AID_NET_BT  = 3002; /* bluetooth: create sco,
>  rfcomm or l2cap
> sockets */
>   public static final int AID_INET= 3003; /* can create AF_INET and
>  AF_INET6 sockets */
>   public static final int AID_NET_RAW = 3004; /* can create raw INET
> sockets
>*/
>   public static final int AID_MISC= 9998; /* access to misc
> storage */
>   public static final int AID_NOBODY  = ;
>   public static final int AID_APP     =1; /* first app user */
>
>
> It's probably *AIDL*.
>
> http://developer.android.com/guide/components/aidl.html
>
>
> On Monday, August 27, 2012 7:59:03 AM UTC-5, thejaswi s wrote:
>>
>> I was just going through powertutor source code and found
>> many constants related to WiFi, CPU and LCD components. I can understand
>> the flow but not getting about these constants.I am curious to know about
>> this. Where these constants are derived from ? what are the standard
>> values? etc.. Please point me to the link where I can get these
>> information. Please do reply.
>>
>>
>>
>>  --
> 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] Don't understand the constants provided in powertutor

2012-08-27 Thread thejaswi s
I was just going through powertutor source code and found
many constants related to WiFi, CPU and LCD components. I can understand
the flow but not getting about these constants.I am curious to know about
this. Where these constants are derived from ? what are the standard
values? etc.. Please point me to the link where I can get these
information. Please do reply.

-- 
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] How to get battery usage from cpu usage in android

2012-08-22 Thread thejaswi s
Even I am looking for an approximate value of battery usage. is there any
method to do that.

On Wed, Aug 22, 2012 at 12:11 PM, Dianne Hackborn wrote:

> There isn't an API to retrieve this.  The computation done for the battery
> stats UI is a complicated approximation (taking into account CPU stepping
> etc to some degree) that is very much an approximation.  It is not accurate
> enough that I would want it available through an API.
>
>
> On Tue, Aug 21, 2012 at 8:53 PM, thejaswi s  wrote:
>
>>  A bove link suggested by  Asheesh arya  saying about present technology
>> ,plugged, scale, health, voltage, level, temperature, status . but not
>> about how much battery is consuming to process cpu cycles. So please tel me
>> how cpu usage related with battery usage using a equation.
>>
>>
>> On Tue, Aug 21, 2012 at 5:09 PM, Asheesh Arya 
>> wrote:
>>
>>> just go through this link might be you get some idea
>>> http://www.krvarma.com/2010/07/getting-battery-information-in-android/
>>>
>>> --
>>> 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
>>
>
>
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  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
>

-- 
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] How to get battery usage from cpu usage in android

2012-08-21 Thread thejaswi s
 A bove link suggested by  Asheesh arya  saying about present technology ,
plugged, scale, health, voltage, level, temperature, status . but not about
how much battery is consuming to process cpu cycles. So please tel me how
cpu usage related with battery usage using a equation.

On Tue, Aug 21, 2012 at 5:09 PM, Asheesh Arya wrote:

> just go through this link might be you get some idea
> http://www.krvarma.com/2010/07/getting-battery-information-in-android/
>
> --
> 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] How to get battery usage from cpu usage in android

2012-08-21 Thread thejaswi s
I got cpu usage from following link
http://stackoverflow.com/questions/3118234/how-to-get-memory-usage-and-cpu-usage-in-android.
Can any one give idea about how much battery(in joules or watt) consumed to
use this amount of cpu. Is there any formula to calculate it.
Thanks in advance.

-- 
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] How to get cpu elapsed of other processes which are in background in android?

2012-08-15 Thread thejaswi s
How to get cpu elapsed of other processes which are in background in
android?


In my application I want to get CPU elapsed time of other processes which
are running in background. How can I do it. Thanks in advance.

-- 
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] BroadCast Receiver()

2012-08-07 Thread thejaswi s
The class BroadcastReceiver defines the onReceive() method. Only during
this method your BroadcastReceiver object will be valid, afterwards the
Android system can recycle the BroadcastReceiver. Therefore you cannot
perform any asynchronous operation in the onReceive() method.
refer:
http://www.vogella.com/articles/AndroidBroadcastReceiver/article.html

-- 
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] Is there any other way to find traffic stats in android other than using trafficstats API?

2012-08-03 Thread thejaswi s
Data usage per application. Based on uid I can take third party application
data usage from my app using 'TrafficStats' API. But this will get reset in
sertain condition. So is there any other way to take data usage per
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] Is there any other way to find traffic stats in android other than using trafficstats API?

2012-08-02 Thread thejaswi s
In my application I want to calculate data when application is in
foreground. I am using Trafficstats API. But some time this value get reset
and start from 0. Is there any other method or API to take data usage other
than Trafficstats which will never get reset. Thanks in advance

-- 
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] Is rx tx value from traffic stats is application specific?

2012-08-01 Thread thejaswi s
I am finding each application data usage by using uid in traffic stats API.
But Is this Rx Tx values resetting is application specific. Because youTube
application value resetting is more frequent compare to gmail. Thanks in
advance

-- 
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] why TrafficStats values reset?

2012-07-31 Thread thejaswi s
I referred the following link
http://code.google.com/p/android/issues/detail?id=19938 Is there any reason
why TrafficStats values might be reset apart from on Shutdown? and found
that values get reset when reboot or when we move from WiFi to 3g. But its
a long value.

* *If it exceeds the limit is it gets reset to 0.

* *Can any one tel me what is the maximum limit of the traffic stat value.

* *Is there any another reason for this value resting.

thanks in advance.

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