[android-developers] ProgressBar width

2013-11-29 Thread Kristoffer
Hello.

Iam creating a progressbar 
with  style=?android:attr/progressBarStyleHorizontal
and iam also created a textview that iam adding ontop of the progressbar 
to show the actual value.

Iam using relativelayout.

Is it possible somehow to make the width of the progressbar to match the 
textview.
So that the length of the progressbar changes to match the width of the 
textview.

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


Re: [android-developers] ProgressBar width

2013-11-29 Thread Kristoffer
Hello.
That worked.
Thanks for that great answer.

Den fredagen den 29:e november 2013 kl. 23:43:24 UTC+1 skrev TreKing:


 On Fri, Nov 29, 2013 at 4:56 AM, Kristoffer kris.is...@gmail.comjavascript:
  wrote:

 Iam using relativelayout.

 Is it possible somehow to make the width of the progressbar to match the 
 textview.
 So that the length of the progressbar changes to match the width of the 
 textview.


 Try setting progress bar to alignLeft and alignRight relative to the 
 TextView.


 -
 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
--- 
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] Re: HttpClient GC_Concurrent freed

2013-07-30 Thread Kristoffer
Hello.
Thanks for reply.
I have tryed to look at threads and Heap but i could not find what the 
problem was.
I will try again if i could find anything.

Den måndagen den 29:e juli 2013 kl. 08:22:12 UTC+2 skrev Kristoffer:

 Hello.
 Iam having trouble with memory leak it will finaly cause the app to force 
 close.
 I have stripped down my code just to find where the problem is and i 
 located it to my httpclient.

 When i run this code iam geting many GC_Concurrent freed.
 if i add a Thread.sleep(1000); then i will ofcourse get less warnings but 
 my guess is that there is still some problem with the code i run.
 Is there a way i could prevent the problem.

 Here is the code:

 Thread c = new Thread() {
 @Override
 public void run() {
 String xml;
  UsernamePasswordCredentials creds = new 
 UsernamePasswordCredentials(username, password); 
  HttpGet httpGet;
  HttpClient httpClient;
  HttpResponse httpResponse;
  HttpEntity httpEntity;
  while (RunThread) {

  try {
  httpClient = HttpClientFactory.getThreadSafeClient();
  httpGet = new HttpGet(http://ipaddress/list?format=xml;);
  httpGet.addHeader(new BasicScheme().authenticate(creds, 
 httpGet));
  httpResponse = httpClient.execute(httpGet);
  httpEntity = httpResponse.getEntity();
  xml = EntityUtils.toString(httpEntity, UTF-8);
  
  
  } catch (Exception e) { 
  e.printStackTrace();
  
  } 
 }
 };
 c.start();
 } 

 And here is the class HttpClientFactory

 public class HttpClientFactory {

 private static DefaultHttpClient client;

 public synchronized static DefaultHttpClient getThreadSafeClient() {
   
 if (client != null)
 return client;
  
 client = new DefaultHttpClient();
 
 ClientConnectionManager mgr = client.getConnectionManager();
 
 HttpParams params = client.getParams();
 params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 
 1);
 params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 1);
 client = new DefaultHttpClient(
 new ThreadSafeClientConnManager(params,
 mgr.getSchemeRegistry()), params);
   
 return client;
 } 
 }


 Have a made some huge mistage in the code that is causing this issue?


-- 
-- 
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] Re: HttpClient GC_Concurrent freed

2013-07-30 Thread Kristoffer
Hello,
Thanks for the answer.
Iam going to rewrite my code and i hope there is some part in the old 
onethat is making this issue, i have never seen this before so i hope its a 
one time only.
Thanks for your time.

Den måndagen den 29:e juli 2013 kl. 08:22:12 UTC+2 skrev Kristoffer:

 Hello.
 Iam having trouble with memory leak it will finaly cause the app to force 
 close.
 I have stripped down my code just to find where the problem is and i 
 located it to my httpclient.

 When i run this code iam geting many GC_Concurrent freed.
 if i add a Thread.sleep(1000); then i will ofcourse get less warnings but 
 my guess is that there is still some problem with the code i run.
 Is there a way i could prevent the problem.

 Here is the code:

 Thread c = new Thread() {
 @Override
 public void run() {
 String xml;
  UsernamePasswordCredentials creds = new 
 UsernamePasswordCredentials(username, password); 
  HttpGet httpGet;
  HttpClient httpClient;
  HttpResponse httpResponse;
  HttpEntity httpEntity;
  while (RunThread) {

  try {
  httpClient = HttpClientFactory.getThreadSafeClient();
  httpGet = new HttpGet(http://ipaddress/list?format=xml;);
  httpGet.addHeader(new BasicScheme().authenticate(creds, 
 httpGet));
  httpResponse = httpClient.execute(httpGet);
  httpEntity = httpResponse.getEntity();
  xml = EntityUtils.toString(httpEntity, UTF-8);
  
  
  } catch (Exception e) { 
  e.printStackTrace();
  
  } 
 }
 };
 c.start();
 } 

 And here is the class HttpClientFactory

 public class HttpClientFactory {

 private static DefaultHttpClient client;

 public synchronized static DefaultHttpClient getThreadSafeClient() {
   
 if (client != null)
 return client;
  
 client = new DefaultHttpClient();
 
 ClientConnectionManager mgr = client.getConnectionManager();
 
 HttpParams params = client.getParams();
 params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 
 1);
 params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 1);
 client = new DefaultHttpClient(
 new ThreadSafeClientConnManager(params,
 mgr.getSchemeRegistry()), params);
   
 return client;
 } 
 }


 Have a made some huge mistage in the code that is causing this issue?


-- 
-- 
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] HttpClient GC_Concurrent freed

2013-07-29 Thread Kristoffer
Hello.
Iam having trouble with memory leak it will finaly cause the app to force 
close.
I have stripped down my code just to find where the problem is and i 
located it to my httpclient.

When i run this code iam geting many GC_Concurrent freed.
if i add a Thread.sleep(1000); then i will ofcourse get less warnings but 
my guess is that there is still some problem with the code i run.
Is there a way i could prevent the problem.

Here is the code:

Thread c = new Thread() {
@Override
public void run() {
String xml;
 UsernamePasswordCredentials creds = new 
UsernamePasswordCredentials(username, password); 
 HttpGet httpGet;
 HttpClient httpClient;
 HttpResponse httpResponse;
 HttpEntity httpEntity;
 while (RunThread) {

 try {
 httpClient = HttpClientFactory.getThreadSafeClient();
 httpGet = new HttpGet(http://ipaddress/list?format=xml;);
 httpGet.addHeader(new BasicScheme().authenticate(creds, httpGet));
 httpResponse = httpClient.execute(httpGet);
 httpEntity = httpResponse.getEntity();
 xml = EntityUtils.toString(httpEntity, UTF-8);
 
 
 } catch (Exception e) { 
 e.printStackTrace();
 
 } 
}
};
c.start();
} 

And here is the class HttpClientFactory

public class HttpClientFactory {

private static DefaultHttpClient client;

public synchronized static DefaultHttpClient getThreadSafeClient() {
  
if (client != null)
return client;
 
client = new DefaultHttpClient();

ClientConnectionManager mgr = client.getConnectionManager();

HttpParams params = client.getParams();
params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 
1);
params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 1);
client = new DefaultHttpClient(
new ThreadSafeClientConnManager(params,
mgr.getSchemeRegistry()), params);
  
return client;
} 
}


Have a made some huge mistage in the code that is causing this issue?

-- 
-- 
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] Re: HttpClient GC_Concurrent freed

2013-07-29 Thread Kristoffer
Hello.
Yes that is what i want it to do.
This is a background thread that is started RunThread = true on 
onResume() and i set it false on onPause() and on onStop().
So as long the activity is active then this should run in background and 
connect a web server and later in the code iam processing the String xml (i 
disabled that part now when iam locking for the memory leak)

Here is a short period of my logcat when this loop is running.

07-30 04:19:59.205: D/dalvikvm(1863): GC_CONCURRENT freed 325K, 21% free 
3528K/4432K, paused 28ms+27ms, total 210ms
07-30 04:20:00.626: D/dalvikvm(1863): GC_CONCURRENT freed 433K, 21% free 
3509K/4432K, paused 22ms+23ms, total 226ms
07-30 04:20:02.037: D/dalvikvm(1863): GC_CONCURRENT freed 407K, 21% free 
3506K/4432K, paused 31ms+23ms, total 151ms
07-30 04:20:03.887: D/dalvikvm(1863): GC_CONCURRENT freed 412K, 21% free 
3507K/4432K, paused 73ms+48ms, total 271ms
07-30 04:20:05.235: D/dalvikvm(1863): GC_CONCURRENT freed 408K, 21% free 
3503K/4432K, paused 194ms+24ms, total 324ms
07-30 04:20:06.555: D/dalvikvm(1863): GC_CONCURRENT freed 401K, 21% free 
3505K/4432K, paused 109ms+153ms, total 390ms
07-30 04:20:07.917: D/dalvikvm(1863): GC_CONCURRENT freed 412K, 21% free 
3510K/4432K, paused 144ms+68ms, total 396ms
07-30 04:20:09.167: D/dalvikvm(1863): GC_CONCURRENT freed 408K, 21% free 
3510K/4432K, paused 125ms+5ms, total 295ms
07-30 04:20:10.736: D/dalvikvm(1863): GC_CONCURRENT freed 413K, 21% free 
3503K/4432K, paused 129ms+144ms, total 361ms
07-30 04:20:12.045: D/dalvikvm(1863): GC_CONCURRENT freed 401K, 21% free 
3509K/4432K, paused 117ms+31ms, total 283ms
07-30 04:20:13.715: D/dalvikvm(1863): GC_CONCURRENT freed 412K, 21% free 
3508K/4432K, paused 106ms+35ms, total 238ms
07-30 04:20:15.335: D/dalvikvm(1863): GC_CONCURRENT freed 414K, 21% free 
3506K/4432K, paused 15ms+129ms, total 349ms
07-30 04:20:16.695: D/dalvikvm(1863): GC_CONCURRENT freed 402K, 21% free 
3511K/4432K, paused 103ms+20ms, total 222ms
07-30 04:20:17.675: D/dalvikvm(1863): GC_CONCURRENT freed 406K, 22% free 
3496K/4432K, paused 5ms+4ms, total 81ms
07-30 04:20:19.337: D/dalvikvm(1863): GC_CONCURRENT freed 401K, 21% free 
3509K/4432K, paused 103ms+135ms, total 451ms
07-30 04:20:21.045: D/dalvikvm(1863): GC_CONCURRENT freed 412K, 21% free 
3508K/4432K, paused 97ms+137ms, total 365ms
07-30 04:20:22.536: D/dalvikvm(1863): GC_CONCURRENT freed 415K, 20% free 
3558K/4432K, paused 113ms+179ms, total 436ms
07-30 04:20:24.105: D/dalvikvm(1863): GC_CONCURRENT freed 452K, 21% free 
3531K/4432K, paused 5ms+31ms, total 136ms
07-30 04:20:25.655: D/dalvikvm(1863): GC_CONCURRENT freed 415K, 21% free 
3537K/4432K, paused 152ms+129ms, total 414ms
07-30 04:20:27.277: D/dalvikvm(1863): GC_CONCURRENT freed 435K, 21% free 
3508K/4432K, paused 140ms+41ms, total 288ms
07-30 04:20:28.655: D/dalvikvm(1863): GC_CONCURRENT freed 412K, 21% free 
3515K/4432K, paused 197ms+132ms, total 396ms
07-30 04:20:29.975: D/dalvikvm(1863): GC_CONCURRENT freed 427K, 22% free 
3496K/4432K, paused 138ms+5ms, total 311ms
07-30 04:20:31.305: D/dalvikvm(1863): GC_CONCURRENT freed 397K, 21% free 
3510K/4432K, paused 88ms+182ms, total 403ms
07-30 04:20:32.797: D/dalvikvm(1863): GC_CONCURRENT freed 406K, 21% free 
3507K/4432K, paused 119ms+22ms, total 285ms
07-30 04:20:34.385: D/dalvikvm(1863): GC_CONCURRENT freed 407K, 21% free 
3507K/4432K, paused 4ms+123ms, total 256ms
07-30 04:20:35.615: D/dalvikvm(1863): GC_CONCURRENT freed 407K, 21% free 
3512K/4432K, paused 99ms+170ms, total 406ms
07-30 04:20:36.895: D/dalvikvm(1863): GC_CONCURRENT freed 415K, 22% free 
3500K/4432K, paused 106ms+5ms, total 239ms
07-30 04:20:38.395: D/dalvikvm(1863): GC_CONCURRENT freed 439K, 21% free 
3538K/4432K, paused 155ms+187ms, total 481ms
07-30 04:20:39.475: D/dalvikvm(1863): GC_CONCURRENT freed 420K, 21% free 
3534K/4432K, paused 5ms+133ms, total 250ms
07-30 04:20:40.815: D/dalvikvm(1863): GC_CONCURRENT freed 421K, 21% free 
3528K/4432K, paused 114ms+136ms, total 425ms
07-30 04:20:42.065: D/dalvikvm(1863): GC_CONCURRENT freed 429K, 21% free 
3506K/4432K, paused 115ms+132ms, total 383ms
07-30 04:20:43.295: D/dalvikvm(1863): GC_CONCURRENT freed 411K, 21% free 
3504K/4432K, paused 109ms+33ms, total 247ms
07-30 04:20:44.575: D/dalvikvm(1863): GC_CONCURRENT freed 408K, 21% free 
3510K/4432K, paused 15ms+21ms, total 175ms





Den tisdagen den 30:e juli 2013 kl. 03:42:13 UTC+2 skrev RichardC:

 Your while loop starting
 while (RunThread) {

 in your run() method will loop until an external event resets RunThread. 
  Is this what you intended?  Try putting a log line inside the while  loop 
 and watching the LogCat output.

 On Monday, July 29, 2013 7:22:12 AM UTC+1, Kristoffer wrote:

 Hello.
 Iam having trouble with memory leak it will finaly cause the app to force 
 close.
 I have stripped down my code just to find where the problem is and i 
 located it to my httpclient.

 When i run this code iam geting many GC_Concurrent freed.
 if i add a Thread.sleep(1000); then i

[android-developers] Re: HttpClient GC_Concurrent freed

2013-07-29 Thread Kristoffer
):   at 
org.apache.http.util.EntityUtils.toString(EntityUtils.java:131)
07-30 05:31:25.975: I/dalvikvm(10021):   at 
com.example.androidtablayout.StringActivity$4.run(StringActivity.java:323)
07-30 05:31:26.099: W/dalvikvm(10021): threadid=17: thread exiting with 
uncaught exception (group=0x40a71930)
07-30 05:31:26.105: E/AndroidRuntime(10021): FATAL EXCEPTION: Thread-146
07-30 05:31:26.105: E/AndroidRuntime(10021): java.lang.OutOfMemoryError
07-30 05:31:26.105: E/AndroidRuntime(10021): at 
org.apache.http.util.CharArrayBuffer.init(CharArrayBuffer.java:55)
07-30 05:31:26.105: E/AndroidRuntime(10021): at 
org.apache.http.util.EntityUtils.toString(EntityUtils.java:131)
07-30 05:31:26.105: E/AndroidRuntime(10021): at 
com.example.androidtablayout.StringActivity$4.run(StringActivity.java:323)


Den måndagen den 29:e juli 2013 kl. 08:22:12 UTC+2 skrev Kristoffer:

 Hello.
 Iam having trouble with memory leak it will finaly cause the app to force 
 close.
 I have stripped down my code just to find where the problem is and i 
 located it to my httpclient.

 When i run this code iam geting many GC_Concurrent freed.
 if i add a Thread.sleep(1000); then i will ofcourse get less warnings but 
 my guess is that there is still some problem with the code i run.
 Is there a way i could prevent the problem.

 Here is the code:

 Thread c = new Thread() {
 @Override
 public void run() {
 String xml;
  UsernamePasswordCredentials creds = new 
 UsernamePasswordCredentials(username, password); 
  HttpGet httpGet;
  HttpClient httpClient;
  HttpResponse httpResponse;
  HttpEntity httpEntity;
  while (RunThread) {

  try {
  httpClient = HttpClientFactory.getThreadSafeClient();
  httpGet = new HttpGet(http://ipaddress/list?format=xml;);
  httpGet.addHeader(new BasicScheme().authenticate(creds, 
 httpGet));
  httpResponse = httpClient.execute(httpGet);
  httpEntity = httpResponse.getEntity();
  xml = EntityUtils.toString(httpEntity, UTF-8);
  
  
  } catch (Exception e) { 
  e.printStackTrace();
  
  } 
 }
 };
 c.start();
 } 

 And here is the class HttpClientFactory

 public class HttpClientFactory {

 private static DefaultHttpClient client;

 public synchronized static DefaultHttpClient getThreadSafeClient() {
   
 if (client != null)
 return client;
  
 client = new DefaultHttpClient();
 
 ClientConnectionManager mgr = client.getConnectionManager();
 
 HttpParams params = client.getParams();
 params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 
 1);
 params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 1);
 client = new DefaultHttpClient(
 new ThreadSafeClientConnManager(params,
 mgr.getSchemeRegistry()), params);
   
 return client;
 } 
 }


 Have a made some huge mistage in the code that is causing this issue?


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




Re: [android-developers] Re: android:windowIsFloating

2012-07-12 Thread Kristoffer
Okey, then i know.
Thanks.

Den onsdagen den 11:e juli 2012 kl. 21:53:50 UTC+2 skrev Dianne Hackborn:

 A non-fullscreen window wraps its content.  If your content is allowing 
 itself to be wrapped at a size smaller than works, you have a problem with 
 the layout in your window.

 On Wed, Jul 11, 2012 at 10:55 AM, Kristoffer kris.isak.v...@gmail.comwrote:

 Hello.
 its the same if i use that, the window will be the same size as the 
 content.

 Den onsdagen den 11:e juli 2012 kl. 19:34:24 UTC+2 skrev skink:



 Kristoffer wrote: 
  Hello. 
  Iam trying to make a nice looking popup window 
  iam almost there with the help of android:windowIsFloating in my theme 
 but 
  the thing is that the new window is wraping content to set its size. 
  What i want is that the new window should almost fill the whole 
 screen, it 
  should just be little smaller that the background activity just to 
 show 
  thats its a popup window. 
  
  Yes, sure i could hardcode a size but i want it to look good on any 
 size so 
  the best would be if i some way could set the size to like 80 % of 
 screen 
  size? 
  maybe there is a default android theme that i could use? 


 sure it is: 

 activity android:theme = @ 
 android:style/ 
 Theme.Dialog  

 pskink

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

[android-developers] android:windowIsFloating

2012-07-11 Thread Kristoffer
Hello.
Iam trying to make a nice looking popup window
iam almost there with the help of android:windowIsFloating in my theme but 
the thing is that the new window is wraping content to set its size.
What i want is that the new window should almost fill the whole screen, it 
should just be little smaller that the background activity just to show 
thats its a popup window.
 
Yes, sure i could hardcode a size but i want it to look good on any size so 
the best would be if i some way could set the size to like 80 % of screen 
size?
maybe there is a default android theme that i could use?

-- 
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: android:windowIsFloating

2012-07-11 Thread Kristoffer
Hello.
its the same if i use that, the window will be the same size as the content.

Den onsdagen den 11:e juli 2012 kl. 19:34:24 UTC+2 skrev skink:



 Kristoffer wrote: 
  Hello. 
  Iam trying to make a nice looking popup window 
  iam almost there with the help of android:windowIsFloating in my theme 
 but 
  the thing is that the new window is wraping content to set its size. 
  What i want is that the new window should almost fill the whole screen, 
 it 
  should just be little smaller that the background activity just to show 
  thats its a popup window. 
  
  Yes, sure i could hardcode a size but i want it to look good on any size 
 so 
  the best would be if i some way could set the size to like 80 % of 
 screen 
  size? 
  maybe there is a default android theme that i could use? 


 sure it is: 

 activity android:theme = @ 
 android:style/ 
 Theme.Dialog  

 pskink

-- 
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: Repeat background

2012-06-15 Thread Kristoffer
Hello.
 
I have verifyed that the problem is on several phones as well, not only the 
emulator.
Is there a better way to repeat background images? that will work on all 
phones?
 

Den måndagen den 28:e maj 2012 kl. 11:38:01 UTC+2 skrev Kristoffer:

 Hello. 
 Iam using a small image and repeats it as a background in my app, 
 this 
 is how i do it. 

 bgrepeat.png 
 backgroundrepeat.xml 


 i have them in the drawable folder. 


 This is how the .xml look like. 


 bitmap 
 xmlns:android=http://schemas.android.com/apk/res/android; 
 android:src=@drawable/bgrepeat 
 android:tileMode=repeat 
 android:dither=true 
 / 


 And i just call in in xml like this. 
 android:background=@drawable/backgroundrepeat 


 If i run this on my Galaxy S2 then the background repeats and looks 
 good, but if i try on a tablet (galaxy 8.9) then it does not repeat 
 it 
 just zooms the bgrepeat.png file, and same result in emulator on my 
 pc. 

 I need to know that this will work on most devices, and why it doesent 
 work on every device.. bug? 
 Any idees? 


-- 
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: Repeat background

2012-06-08 Thread Kristoffer
Den måndagen den 28:e maj 2012 kl. 11:38:01 UTC+2 skrev Kristoffer:
 Hello.
 Iam using a small image and repeats it as a background in my app,
 this
 is how i do it.
 
 bgrepeat.png
 backgroundrepeat.xml
 
 
 i have them in the drawable folder.
 
 
 This is how the .xml look like.
 
 
 bitmap
 xmlns:android=http://schemas.android.com/apk/res/android;
 android:src=@drawable/bgrepeat
 android:tileMode=repeat
 android:dither=true
 /
 
 
 And i just call in in xml like this.
 android:background=@drawable/backgroundrepeat
 
 
 If i run this on my Galaxy S2 then the background repeats and looks
 good, but if i try on a tablet (galaxy 8.9) then it does not repeat
 it
 just zooms the bgrepeat.png file, and same result in emulator on my
 pc.
 
 I need to know that this will work on most devices, and why it doesent
 work on every device.. bug?
 Any idees?

-- 
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] Repeat background

2012-05-28 Thread Kristoffer
Hello.
Iam using a small image and repeats it as a background in my app,
this
is how i do it.

bgrepeat.png
backgroundrepeat.xml


i have them in the drawable folder.


This is how the .xml look like.


bitmap
xmlns:android=http://schemas.android.com/apk/res/android;
android:src=@drawable/bgrepeat
android:tileMode=repeat
android:dither=true
/


And i just call in in xml like this.
android:background=@drawable/backgroundrepeat


If i run this on my Galaxy S2 then the background repeats and looks
good, but if i try on a tablet (galaxy 8.9) then it does not repeat
it
just zooms the bgrepeat.png file, and same result in emulator on my
pc.

I need to know that this will work on most devices, and why it doesent
work on every device.. bug?
Any idees?

-- 
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: Repeat background

2012-05-28 Thread Kristoffer
Hello.

thanks for the reply, i have tryed with the stretch to fit to zoom
to fit and it dident solve the issue on the tablet.
And i see this problem on the emulator when i run it on my computer.

On 28 Maj, 11:50, Iain King iaink...@gmail.com wrote:
 On Monday, 28 May 2012 10:38:01 UTC+1, Kristoffer wrote:

  Hello.
  Iam using a small image and repeats it as a background in my app,
  this
  is how i do it.

  bgrepeat.png
  backgroundrepeat.xml

  i have them in the drawable folder.

  This is how the .xml look like.

  bitmap
      xmlns:android=http://schemas.android.com/apk/res/android;
      android:src=@drawable/bgrepeat
      android:tileMode=repeat
      android:dither=true
  /

  And i just call in in xml like this.
  android:background=@drawable/backgroundrepeat

  If i run this on my Galaxy S2 then the background repeats and looks
  good, but if i try on a tablet (galaxy 8.9) then it does not repeat
  it
  just zooms the bgrepeat.png file, and same result in emulator on my
  pc.

  I need to know that this will work on most devices, and why it doesent
  work on every device.. bug?
  Any idees?

 I'm not sure if this is your issue, but I had a slight glitch on a tablet:
 the tablet had a user controlled scaling thing to 'help' it better run
 phone games.  My app automatically detected the screen size and scaled
 itself accordingly, but if the tablet's scaler was turned on then it messed
 it up. The user report was:

 ---
 Had a slight issue with the background image not filling the screen but was
 easily resolved by changing settings from stretch to fit to zoom to fit
 ---

 Same issue?

 Iain

-- 
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: protected static boolean

2012-05-20 Thread Kristoffer
I dident mean that i should change context.getPackageManager();

but beffore i did send null so context = null but now i send self so
context = self.

Iam running the code now and it works great.
Thanks again

On 19 Maj, 22:49, Jason Teagle teagle.ja...@gmail.com wrote:
 and then it will be PackageManager manager =
 this.getPackageManager();

 Not quite. In a static method, there is no 'this' because the method does
 not belong to an instance of the class - but to the class as a whole. You
 will find that it won't compile.

 Inside your isProInstalled() method, using 'context' was correct.

-- 
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] protected static boolean

2012-05-19 Thread Kristoffer
Hello.
Iam trying to create a If statment based on thsi protected static
boolean.

protected static boolean isProInstalled(Context context) {
PackageManager manager = context.getPackageManager();
if (manager.checkSignatures(context.getPackageName(),
packagename.to.search.for)
== PackageManager.SIGNATURE_MATCH) {
//Pro key installed, and signatures match
return true;
}
return false;
}

And then i try with this:

if (isProInstalled(null) {
//code when true
}

And that will throw me a NullPointerException.
I guess that its something simple, but maybe somebody could point me
in the right direction here?

-- 
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: protected static boolean

2012-05-19 Thread Kristoffer
Well the problem is that iam trying to make somthing happen that iam
not really understand (iam trying to learn)

So what i wanna do is to grabb the return true or the return
false so that i could create my if statement.

On 19 Maj, 21:09, Jason Teagle teagle.ja...@gmail.com wrote:
 And that will throw me a NullPointerException.
 I guess that its something simple, but maybe somebody could point me
 in the right direction here?

 This is the variable you have declared as the parameter:

     protected static boolean isProInstalled(Context __context__) {

 This is what you then try to do with it:

         PackageManager manager = __context__.getPackageManager();
         if (manager.checkSignatures(__context__.getPackageName(),

 This is the value you are passing for that parameter:

     if (isProInstalled(__null__) {

 What did you *expect* to happen if you try to call a method on a variable 
 that now contains null?

-- 
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: protected static boolean

2012-05-19 Thread Kristoffer
Thanks for clearing this up for me,
Now i understand what i did, and offcourse i did send null to context
and that will not work. now i do like this:
if (isProInstalled(this)

and then it will be PackageManager manager =
this.getPackageManager();

I have to say that your answer was very good, thanks for the time it
took you.

On 19 Maj, 21:47, Jason Teagle teagle.ja...@gmail.com wrote:
 Well the problem is that iam trying to make somthing happen that iam
 not really understand (iam trying to learn)

 So what i wanna do is to grabb the return true or the return
 false so that i could create my if statement.

 In that respect - using the static function call to grab the result for an if 
 statement - you were using it correctly.

 What you must understand, though, is that in order to get through that static 
 method and return an answer to you, it must execute the code within the 
 method. That means that you must pass it valid data to work with (or code to 
 *expect* null references as an acceptable condition), otherwise at run time 
 it will do exactly what it did to you - throw an exception.

 An exception is the Java mechanism for alerting you to the fact that 
 something bad happened at run time, and it exits out to the nearest catch 
 handler it can as soon as possible - but not exactly gracefully (it may 
 unwind the stack for you, but it won't return the value you intended - 
 because code never gets that far). If you don’t explicitly add a try / catch 
 block higher up the call chain, then your app will die.

 For defending against exceptions you could use a try / catch block around the 
 code in your isProInstalled() method - but in your case I advise against that 
 for now, as it's likely going to hide a lot of problems you will encounter 
 until your understanding improves.

 If your method is asking for a context and trying to use it, ask yourself why 
 you are not passing it any valid context. Can you get a valid context to pass 
 to it?

 If you *want* to be able to get a quick answer without passing a valid 
 context, then you need to code your method to check the context reference 
 before you use it - and return an appropriate response if it is null. For 
 example:

 protected static boolean isProInstalled(Context context) {
     if (context == null)
         return false ; // No valid context - can't tell if it's installed.
     PackageManager manager = context.getPackageManager();
 ...

 Since your method requires the context to be able to do its job, you need to 
 try and get a valid context to pass to the method.

 If you are calling this code somewhere from an Activity, then the activity 
 itself is a context you can pass (as ‘this’).

-- 
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] Random() gives same result

2012-03-23 Thread Kristoffer
Hello.

Iam having a problem with the Random()

everything gets random except for cards[0][0] that always ends up with
= 5

here is the code that i use, anyone have a solution?
in the code ROW_COUNT = 3 and COL_COUNT = 4

private void loadCards(){
try{
int size = ROW_COUNT*COL_COUNT;

ArrayListInteger list = new ArrayListInteger();

for(int i=0;isize;i++){
list.add(new Integer(i));
}

Random r = new Random();

for(int i=size-1;i=0;i--){
int t=0;

if(i0){
t = r.nextInt(i);
}

t=list.remove(t).intValue();
cards[i%COL_COUNT][i/COL_COUNT]=t%(size/2);
}
}
catch (Exception e) {
Log.e(loadCards(), e+);
}

}



-- 
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: Random() gives same result

2012-03-23 Thread Kristoffer
Even if this is not Android at least iam using it in a android
application ;)

It seems that you know what you are talking about, do you have the
time to point me in the right direction here,
is it possible to solve in the way my code works?


On 23 mar, 15:51, Mark Murphy mmur...@commonsware.com wrote:
 This has nothing to do with Android. You are not requesting a random
 number when i==0.





 On Fri, Mar 23, 2012 at 10:48 AM, Kristoffer kris.isak.v...@gmail.com wrote:
  Hello.

  Iam having a problem with the Random()

  everything gets random except for cards[0][0] that always ends up with
  = 5

  here is the code that i use, anyone have a solution?
  in the code ROW_COUNT = 3 and COL_COUNT = 4

  private void loadCards(){
                 try{
                 int size = ROW_COUNT*COL_COUNT;

                 ArrayListInteger list = new ArrayListInteger();

                 for(int i=0;isize;i++){
                         list.add(new Integer(i));
                 }

                 Random r = new Random();

                 for(int i=size-1;i=0;i--){
                         int t=0;

                         if(i0){
                                 t = r.nextInt(i);
                         }

                         t=list.remove(t).intValue();
                         cards[i%COL_COUNT][i/COL_COUNT]=t%(size/2);
                 }
             }
                 catch (Exception e) {
                         Log.e(loadCards(), e+);
                 }

     }

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

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

 _Android Programming Tutorials_ Version 4.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


[android-developers] Re: Random() gives same result

2012-03-23 Thread Kristoffer
Thanks for pointing that out for me.

On 23 mar, 16:12, Kristopher Micinski krismicin...@gmail.com wrote:
                        if(i0){
                                t = r.nextInt(i);
                        }

 should be

                        if(i=0){
                                t = r.nextInt(i);
                        }



 On Fri, Mar 23, 2012 at 11:08 AM, Kristoffer kris.isak.v...@gmail.com wrote:
  Even if this is not Android at least iam using it in a android
  application ;)

  It seems that you know what you are talking about, do you have the
  time to point me in the right direction here,
  is it possible to solve in the way my code works?

  On 23 mar, 15:51, Mark Murphy mmur...@commonsware.com wrote:
  This has nothing to do with Android. You are not requesting a random
  number when i==0.

  On Fri, Mar 23, 2012 at 10:48 AM, Kristoffer kris.isak.v...@gmail.com 
  wrote:
   Hello.

   Iam having a problem with the Random()

   everything gets random except for cards[0][0] that always ends up with
   = 5

   here is the code that i use, anyone have a solution?
   in the code ROW_COUNT = 3 and COL_COUNT = 4

   private void loadCards(){
                  try{
                  int size = ROW_COUNT*COL_COUNT;

                  ArrayListInteger list = new ArrayListInteger();

                  for(int i=0;isize;i++){
                          list.add(new Integer(i));
                  }

                  Random r = new Random();

                  for(int i=size-1;i=0;i--){
                          int t=0;

                          if(i0){
                                  t = r.nextInt(i);
                          }

                          t=list.remove(t).intValue();
                          cards[i%COL_COUNT][i/COL_COUNT]=t%(size/2);
                  }
              }
                  catch (Exception e) {
                          Log.e(loadCards(), e+);
                  }

      }

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

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

  _Android Programming Tutorials_ Version 4.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

-- 
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: Random() gives same result

2012-03-23 Thread Kristoffer
I now tryed that and it gave me a java.lang.illegalArgumentException
when it tryes to add cards[0][0]
something more to the code?

On 23 mar, 16:12, Kristopher Micinski krismicin...@gmail.com wrote:
                        if(i0){
                                t = r.nextInt(i);
                        }

 should be

                        if(i=0){
                                t = r.nextInt(i);
                        }



 On Fri, Mar 23, 2012 at 11:08 AM, Kristoffer kris.isak.v...@gmail.com wrote:
  Even if this is not Android at least iam using it in a android
  application ;)

  It seems that you know what you are talking about, do you have the
  time to point me in the right direction here,
  is it possible to solve in the way my code works?

  On 23 mar, 15:51, Mark Murphy mmur...@commonsware.com wrote:
  This has nothing to do with Android. You are not requesting a random
  number when i==0.

  On Fri, Mar 23, 2012 at 10:48 AM, Kristoffer kris.isak.v...@gmail.com 
  wrote:
   Hello.

   Iam having a problem with the Random()

   everything gets random except for cards[0][0] that always ends up with
   = 5

   here is the code that i use, anyone have a solution?
   in the code ROW_COUNT = 3 and COL_COUNT = 4

   private void loadCards(){
                  try{
                  int size = ROW_COUNT*COL_COUNT;

                  ArrayListInteger list = new ArrayListInteger();

                  for(int i=0;isize;i++){
                          list.add(new Integer(i));
                  }

                  Random r = new Random();

                  for(int i=size-1;i=0;i--){
                          int t=0;

                          if(i0){
                                  t = r.nextInt(i);
                          }

                          t=list.remove(t).intValue();
                          cards[i%COL_COUNT][i/COL_COUNT]=t%(size/2);
                  }
              }
                  catch (Exception e) {
                          Log.e(loadCards(), e+);
                  }

      }

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

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

  _Android Programming Tutorials_ Version 4.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

-- 
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: Random() gives same result

2012-03-23 Thread Kristoffer
Hello.

This is the basic code of a memory game,

cards = new int [COL_COUNT] [ROW_COUNT];

with my first code then the problem was that one card always where at
the same place, and as you noticed with the fix then the code
does throw IllegalArgumentException

On 23 mar, 19:08, a1 arco...@gmail.com wrote:
  Thanks for pointing that out for me.

 This is wrong of course: r.nextInt(0) will throw IllegalArgumentException.

 First of all try to remove try/catch block - you are suppressing all errors
 that way and none of the function that you are calling inside it should
 throw. My guess is that you are getting ArrayIndexOutOfBounds due to
 incorrect indexing here:

 cards[i%COL_​COUNT][i/COL_COUNT]=t%(size/2)​;

 but since I don't know how cards is allocated and what you are trying to
 achieve that's just a guess.

 --
 Bart

-- 
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: Random() gives same result

2012-03-23 Thread Kristoffer
Okey, person number two complaining about my post, its time to take it
elsewhere.

Thanks anyway for trying to help me.

On 23 mar, 19:28, Kristopher Micinski krismicin...@gmail.com wrote:
 Oh, right, okay...

 Well the line where you're doing the assigning makes no sense, as we
 don't know what size is...  In general this is a topic better suited a
 Java forum, not the Android list, since there's nothing specific to
 the SDK in here...

 kris



 On Fri, Mar 23, 2012 at 2:23 PM, Kristoffer kris.isak.v...@gmail.com wrote:
  Hello.

  This is the basic code of a memory game,

  cards = new int [COL_COUNT] [ROW_COUNT];

  with my first code then the problem was that one card always where at
  the same place, and as you noticed with the fix then the code
  does throw IllegalArgumentException

  On 23 mar, 19:08, a1 arco...@gmail.com wrote:
   Thanks for pointing that out for me.

  This is wrong of course: r.nextInt(0) will throw IllegalArgumentException.

  First of all try to remove try/catch block - you are suppressing all errors
  that way and none of the function that you are calling inside it should
  throw. My guess is that you are getting ArrayIndexOutOfBounds due to
  incorrect indexing here:

  cards[i%COL_COUNT][i/COL_COUNT]=t%(size/2);

  but since I don't know how cards is allocated and what you are trying to
  achieve that's just a guess.

  --
  Bart

  --
  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- Dölj citerad text -

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


[android-developers] Re: Random() gives same result

2012-03-23 Thread Kristoffer
Hello again.

I will add myself to that list and see if i could create a topic this
popular ;)

And i never reflect that this issue did not belong here, now i know
better.

By the way, i changed the code to t = r.nextInt(i+1);
it seems that it solved my issue.

On 23 mar, 20:35, TreKing treking...@gmail.com wrote:
 On Fri, Mar 23, 2012 at 2:24 PM, Mark Murphy mmur...@commonsware.comwrote:

   I seem to recall some others elected to create their own beginners
  list, but I do not remember any details.

 https://groups.google.com/forum/?fromgroups#!forum/android-for-beginners

 I help out on that list as well, along with a few others. Much less traffic
 so much easier to get answers and keep up with the list.
 Plus, I'm far less of dick to people on there since it is explicitly for
 beginners. :-)

 ---­--
 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] Need help with relativelayout

2012-02-16 Thread Kristoffer
Hello.
Iam kinfa new to relativelayout so iam not sure how to make this
happens:

I have a relativelayout width fill parent, height wrap content.
I have a image in the top right corner:
android:layout_alignParentTop=true
android:layout_alignParentRight=true

The image is not always there (depends on settings in the app) so i
use:
android:visibility=gone when i dont want to show the image.
This works great, but the problem is that i now wanna add one more
image that i wanna have to the left of the first image and if the
first image isent there then the second should be in top right corner.

so i cant use torightof the first image becourse sometimes its not
there.

Did you understand my question? and do you have a solution for me?
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] Re: Need help with relativelayout

2012-02-16 Thread Kristoffer
Maye i should try to explain some more what i need.
Lets say that i add one more images, so that iam up to three, if all
images is active it would look like this:
CBA if B is gone i would now look like this
C  A i wanna have it like this CA with no space for B.

On 16 Feb, 10:39, Kristoffer kris.isak.v...@gmail.com wrote:
 Hello.
 Iam kinfa new to relativelayout so iam not sure how to make this
 happens:

 I have a relativelayout width fill parent, height wrap content.
 I have a image in the top right corner:
 android:layout_alignParentTop=true
 android:layout_alignParentRight=true

 The image is not always there (depends on settings in the app) so i
 use:
 android:visibility=gone when i dont want to show the image.
 This works great, but the problem is that i now wanna add one more
 image that i wanna have to the left of the first image and if the
 first image isent there then the second should be in top right corner.

 so i cant use torightof the first image becourse sometimes its not
 there.

 Did you understand my question? and do you have a solution for me?
 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] Did i loose my application details

2012-02-11 Thread Kristoffer
Hello.

I did upload an .apk and added all info about my app added two
languages and added text for both. i pushed save but i did not push
publish (wasent sure if i wanted to publish it on the market just
yet.)

After i had pushed save i closet the window and entered to my
developer console but i cant find the app anyware, do i have to remake
all and also have to push publish?

-- 
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: Did i loose my application details

2012-02-11 Thread Kristoffer
Well it just toke some time to show up, so i did everything just
right.

On 11 Feb, 11:30, Kristoffer kris.isak.v...@gmail.com wrote:
 Hello.

 I did upload an .apk and added all info about my app added two
 languages and added text for both. i pushed save but i did not push
 publish (wasent sure if i wanted to publish it on the market just
 yet.)

 After i had pushed save i closet the window and entered to my
 developer console but i cant find the app anyware, do i have to remake
 all and also have to push publish?

-- 
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] Best way to publish on market

2012-02-10 Thread Kristoffer
Hello.

I have made an app that iam going to publish on Market.
I wanna make this app both free and also pay.

Iam going to have the exact same app for both free and pay how should
i do this the best way?

Could a publish the same .apk with just different names (Title when i
publish), like add donate to the end of the pay version?

And if so, what happens if someone downloads the free version and then
downloads the pay version, does it installs the same app two times or
what?

Maybe there is a better way to make this happen?

Thanks for help.

-- 
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 can i copy /dev/block/mtdblock0 on my laptop

2011-10-17 Thread Kristoffer Grundström
Do you have root-priveligies?

On 2011 10 17 13:26, luca aliberti lucal...@gmail.com wrote:

How can i copy /dev/block/mtdblock0 on my laptop?

dd if=/dev/block/mtdblock0 of=/sdcard/system.img bs=2048 is not
working !!!
adb pull /dev/block/mtdblock0 /home is not working !!!

Thanks a lot
Regards
Luca

--
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] Re: working with tabs (tabhost)

2011-10-13 Thread Kristoffer
Hello.

Thanks for a good answer.
Have a nice day.

On 12 Okt, 05:21, Subin Sebastian subinsebast...@gmail.com wrote:
 Hi Kristoffer,

 Hope you were following the tutorial I've posted in the last response. I've
 figured out a way to do your requirement. The idea is to clear all the tabs
 which is loaded before in onClick of the button inside one of the view. You
 can move that code into yout on_preference_change (or what ever you are
 using). Anyway, I'm not sure this is the optimal way to do the same, but it
 works!

 Thanks

 public class HelloTabActivity extends TabActivity {
     int verified = 1;
     TabHost mTabHst;
     View view1,view2;
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
         mTabHst = getTabHost();
         view1 =
 ((LayoutInflater)getApplicationContext().getSystemService(getApplicationCon­text().LAYOUT_INFLATER_SERVICE)).inflate(R.layout.layout_one,(ViewGroup)
 mTabHst.getChildAt(2));
         view2 =
 ((LayoutInflater)getApplicationContext().getSystemService(getApplicationCon­text().LAYOUT_INFLATER_SERVICE)).inflate(R.layout.layout_two,(ViewGroup)
 mTabHst.getChildAt(2));
         view1.findViewById(R.id.button1).setOnClickListener(new
 OnClickListener()    {
             @Override
             public void onClick(View arg0) {
                 verified = 0;
                 setTabs();
             }
         });
         setTabs();
         mTabHst.setCurrentTab(0);
     }
     private void setTabs()    {
         Resources res = getResources();
         mTabHst.clearAllTabs();

 mTabHst.addTab(mTabHst.newTabSpec(tab_test1).setIndicator(One,res.getDr­awable(R.drawable.one)).setContent(new
 TabContentFactory() {
             @Override
             public View createTabContent(String tag) {
                 //int verified = pref.getInt(verified, 0);
                 if (verified == 1)
                     return view1;
                 else
                     return view2;
             }
         }));
     }

 }

 --
 Subin 
 Sebastianwww.nintriva.comhttp://in.linkedin.com/in/subinsebastienhttps://plus.google.com/subinhttps://plus.google.com/118262481642737404812

-- 
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: working with tabs (tabhost)

2011-10-09 Thread Kristoffer
Hello.

Thanks for the reply, but iam not sure how i should implement that in
my code, here is my code that build the tabs.

TabHost tabHost = getTabHost();
TabHost.TabSpec spec;
Intent intent;

intent = new Intent().setClass(this, Main.class);
spec = tabHost.newTabSpec(main).setIndicator(Main)
.setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this, Setting.class);
spec = tabHost.newTabSpec(settings).setIndicator(Settings)
.setContent(intent);
tabHost.addTab(spec);

tabHost.setCurrentTab(0);


And i also have this to work with:

int verified = pref.getInt(verified, 0);

if (verified == 1) {
 Then i need to change tab 1 to Main1.class instead of
Main.class
 }



On 9 Okt, 06:22, Subin Sebastian subinsebast...@gmail.com wrote:
 Hi Kristoffer,
 As I understand from your question, I think you need to set a
 different content for the main tab when you change a specific
 preference in the settings tab. If I'm not wrong the below tutorial
 will help you to do so.

 http://subinsebastien.tumblr.com/post/6783812456/android-tab-layout

 In the above code, instead of passing a new TabSpec, create one
 reusable tabspec like,
 TabHost.TabSpec spec =
 mTabHst.newTabSpec(tab_test1).setIndicator(One,res.getDrawable(R.drawab­le.one)).setContent(i);

 In your method which is triggered on change of specific preference,
 use the following code.

 spec = spec.setContent(your_new_activity);

 I think this code should work, but I did not tested it yet. Please let
 me know if anything goes wrong.

 Thanks

 On 10/9/11, Kristoffer kris.isak.v...@gmail.com wrote:





  Hello.

  Iam not sure this is possible to do but here is what i need to do.

  Iam now creating two tabs one for the main page and one for the
  settings.
  Lets call them main.java and setting.java

  When i change a thing on the setting.java page then i need to show a
  different intent (main1.java) when the user push the main tab.

  Is this possible in some way?

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

 --
 Subin 
 Sebastianhttp://in.linkedin.com/in/subinsebastienhttps://plus.google.com/subinhttps://plus.google.com/118262481642737404812

-- 
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] working with tabs (tabhost)

2011-10-08 Thread Kristoffer
Hello.

Iam not sure this is possible to do but here is what i need to do.

Iam now creating two tabs one for the main page and one for the
settings.
Lets call them main.java and setting.java

When i change a thing on the setting.java page then i need to show a
different intent (main1.java) when the user push the main tab.

Is this possible in some way?

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

2011-10-02 Thread Kristoffer
Oh my reply did not post.

I just wrote that it works great with MessageDigest class.
Thanks for the help.

On 26 Sep, 09:46, Nikolay Elenkov nikolay.elen...@gmail.com wrote:
 On Mon, Sep 26, 2011 at 4:39 PM, Kristoffer kris.isak.v...@gmail.com wrote:
  Hello.

  Is there a easy way of making asha1from a string in android?

 That has actually little to do with Android. For cryptographic
 operations in Java you use the JCE classes:

 http://download.oracle.com/javase/6/docs/technotes/guides/security/cr...



  Right now iam using a a php script that makes it for me and passes the
 sha1string back to the application.

  its very simple in php:

  echosha1('string1'.'string2');

  But it would be much cleaner if i could make this happen inside the
  app instead.

 Use the MessageDigest class. Just make sure you use a fixed
 charset when converting from string to a byte array (ASCII or UTF-8,
 depending on your strings, getBytes() is platform dependent).

 http://developer.android.com/reference/java/security/MessageDigest.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


[android-developers] sendMessage and handleMessage

2011-10-01 Thread Kristoffer
Hello.

Iam having some trouble sending message from a thread back to the
main thread.

I just need to send a integer just so i know what just happend in the
thread.

This is what i use right now,

Message msg = Message.obtain();
msg.what = 1;
progressHandler.sendMessage(msg);

- - - - -

private Handler progressHandler = new Handler() {
@Override
public void handleMessage(Message msg) {

Toast.makeText(getApplicationContext(), msg.toString(),
Toast.LENGTH_LONG).show();

This will show me:
{ what=1 when=somenumbers }

Is there a way so i just could grabb the Int 1 in this case?

Iam then going to build if statments depends on the integer


-- 
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: sendMessage and handleMessage

2011-10-01 Thread Kristoffer
Thanks for the reply, but it gives me this error message:

android.content.res.Resources$NotFoundException:String resource ID
#0x1

Did i do it wrong?

this is the part i changed

msg.arg1 = 1;

- - - - -

Toast.makeText(getApplicationContext(), msg.arg1 ,
Toast.LENGTH_LONG).show();

On 1 Okt, 21:57, Mark Murphy mmur...@commonsware.com wrote:
 Don't do:

 msg.what=1

 Do:

 msg.arg1=1

 Then, on the receiving side, your value will be:

 msg.arg1





 On Sat, Oct 1, 2011 at 3:29 PM, Kristoffer kris.isak.v...@gmail.com wrote:
  Hello.

  Iam having some trouble sending message from a thread back to the
  main thread.

  I just need to send a integer just so i know what just happend in the
  thread.

  This is what i use right now,

  Message msg = Message.obtain();
  msg.what = 1;
  progressHandler.sendMessage(msg);

  - - - - -

  private Handler progressHandler = new Handler() {
  @Override
  public void handleMessage(Message msg) {

  Toast.makeText(getApplicationContext(), msg.toString(),
  Toast.LENGTH_LONG).show();

  This will show me:
  { what=1 when=somenumbers }

  Is there a way so i just could grabb the Int 1 in this case?

  Iam then going to build if statments depends on the integer

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

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

 _The Busy Coder's Guide to Android Development_ Version 3.6 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


[android-developers] Re: sendMessage and handleMessage

2011-10-01 Thread Kristoffer
Thanks so much for the help.

I works great now.

On 1 Okt, 22:37, Kostya Vasilyev kmans...@gmail.com wrote:
 Sure. Toast.makeText(context, int, ...) takes a string resource id as
 its second parameter.

 What you want is:

 Toast.makeText(context, The value is:  + String.valueOf(msg.arg1), ... );

 Or msg.arg2, or msg.what, depending on what exactly you'd like to log.

 And, as a debugging aid, you might as well use logging:

 Log.i(MyApp, The value of x is  + String.valueOf(x));

 This will get printed into the logcat, which can be viewed in Eclipse's
 DDMS perspective (or outside: adb logcat in your operating system's
 command line window).

 -- Kostya

 02.10.2011 0:17, Kristoffer пишет:





  Thanks for the reply, but it gives me this error message:

  android.content.res.Resources$NotFoundException:String resource ID
  #0x1

  Did i do it wrong?

  this is the part i changed

  msg.arg1 = 1;

  - - - - -

  Toast.makeText(getApplicationContext(), msg.arg1 ,
  Toast.LENGTH_LONG).show();

  On 1 Okt, 21:57, Mark Murphymmur...@commonsware.com  wrote:
  Don't do:

  msg.what=1

  Do:

  msg.arg1=1

  Then, on the receiving side, your value will be:

  msg.arg1

  On Sat, Oct 1, 2011 at 3:29 PM, Kristofferkris.isak.v...@gmail.com  
  wrote:
  Hello.
  Iam having some trouble sending message from a thread back to the
  main thread.
  I just need to send a integer just so i know what just happend in the
  thread.
  This is what i use right now,
  Message msg = Message.obtain();
  msg.what = 1;
  progressHandler.sendMessage(msg);
  - - - - -
  private Handler progressHandler = new Handler() {
  @Override
  public void handleMessage(Message msg) {
  Toast.makeText(getApplicationContext(), msg.toString(),
  Toast.LENGTH_LONG).show();
  This will show me:
  { what=1 when=somenumbers }
  Is there a way so i just could grabb the Int 1 in this case?
  Iam then going to build if statments depends on the integer
  --
  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
  --
  Mark Murphy (a Commons 
  Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

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

 --
 Kostya Vasilyev

-- 
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] I wish for help to unlock bootloader for my tablet

2011-09-27 Thread Kristoffer Grundström

Hi!

I own a tablet made by a company called Yifang Digital, it's called eith 
Yifang M7 or Kendo M7.

Here are the specs of it: http://www.yifangdigital.com/product/m7.aspx

It is using Android 2.1  I've both rooted  flashed it using this image:
http://www.netlogic.se/FileArchive/NetlogicWeb/download_files/GB/twk.m7-series.006d-ll.zip

Here are the tool to update it  to install the driver:
http://www.netlogic.se/FileArchive/NetlogicWeb/Produkter/Kendo_M7/Kendo_M7_upgrade_tool_and_drivers.rar

The thing is I'd like to unlock its bootloader to install other 
OS'es.


I have googled a bit on the subject, but no solution seems to be out to 
unlock the bootloader AFAICS.


Now I ask for help to unlock the bootloader of the device.

/Kristoffer

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

2011-09-26 Thread Kristoffer
Hello.

Is there a easy way of making a sha1 from a string in android?

Right now iam using a a php script that makes it for me and passes the
sha1 string back to the application.

its very simple in php:

echo sha1('string1'.'string2');

But it would be much cleaner if i could make this happen inside the
app instead.

Any help?

-- 
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: Textview from thread

2011-09-13 Thread Kristoffer
Thanks.

Its now up and running with Handler

On 10 Sep, 12:53, HideCheck hidech...@gmail.com wrote:
 You need to use the Handler.

 http://developer.android.com/reference/android/os/Handler.html

 Handler handler = new Handler();

 ex)
  public void run() {

         handler.post(new Runnable() {

                         public void run() {
                                 textview.setText(xxx);

                         }
                 });

 }
 }

 2011/9/10 Kristoffer kris.isak.v...@gmail.com:



  Hello.

  I have been searching for answer how to update a textview from another
  thread, i have found several answer that point to using Handler but
  i dont know how i should implement that in my code, maybe you could
  point it out for me.

  Iam checking if the user is logged in or not to Twitter,
  here is my code.

  SettingsActivity.java

  public void updateLoginStatus() {
                 Thread f = new Thread() {
                 public void run() {

                         final TextView loginStatus = (TextView)
  findViewById(R.id.loginstatus);
                         loginStatus.setText(Logged into Twitter :  +
  TwitterUtils.isAuthenticated(prefs));

                 }

             };
             f.start();
         }

  and here is the code in TwitterUtils.java

  public static boolean isAuthenticated(SharedPreferences prefs) {

                 String token = prefs.getString(OAuth.OAUTH_TOKEN, );
                 String secret = prefs.getString(OAuth.OAUTH_TOKEN_SECRET, 
  );

                 AccessToken a = new AccessToken(token,secret);
                 Twitter twitter = new TwitterFactory().getInstance();
                 twitter.setOAuthConsumer(Constants.CONSUMER_KEY,
  Constants.CONSUMER_SECRET);
                 twitter.setOAuthAccessToken(a);

                 try {
                         twitter.getAccountSettings();
                         return true;
                 } catch (TwitterException e) {
                         return false;
                 }
         }

  any good idees?
  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


[android-developers] Textview from thread

2011-09-10 Thread Kristoffer
Hello.

I have been searching for answer how to update a textview from another
thread, i have found several answer that point to using Handler but
i dont know how i should implement that in my code, maybe you could
point it out for me.

Iam checking if the user is logged in or not to Twitter,
here is my code.

SettingsActivity.java

public void updateLoginStatus() {
Thread f = new Thread() {
public void run() {

final TextView loginStatus = (TextView)
findViewById(R.id.loginstatus);
loginStatus.setText(Logged into Twitter :  +
TwitterUtils.isAuthenticated(prefs));

}

};
f.start();
}

and here is the code in TwitterUtils.java

public static boolean isAuthenticated(SharedPreferences prefs) {

String token = prefs.getString(OAuth.OAUTH_TOKEN, );
String secret = prefs.getString(OAuth.OAUTH_TOKEN_SECRET, );

AccessToken a = new AccessToken(token,secret);
Twitter twitter = new TwitterFactory().getInstance();
twitter.setOAuthConsumer(Constants.CONSUMER_KEY,
Constants.CONSUMER_SECRET);
twitter.setOAuthAccessToken(a);

try {
twitter.getAccountSettings();
return true;
} catch (TwitterException e) {
return false;
}
}


any good idees?
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] Shared preferences and integer values

2011-08-13 Thread Kristoffer
Hello.

Iam using shared preferences to store some values.

final SharedPreferences pref = getSharedPreferences(MyPref,
MODE_PRIVATE);

final SharedPreferences.Editor edit = pref.edit();

edit.putInt(Int_value, 1);
edit.putString(String_Value, test string);
edit.commit();


i look in the xml file and everything is saves as it should.

now i grabb the values:

int i = pref.getInt(Int_Value, 200);
String s = pref.getString(String_Value, );

and now i wanna add it to a text label:

I have this in top of my code

final TextView test = (TextView) findViewById(R.id.test);

and then if i wanna show the string everything works as it should.

test.setText(s);

if i try to show the int value with this

test.setText(i);

then my application make a force close, so i thougt that the problem
was that i had to make the int a string so i did like this

 test.setText(Integer.toString(i));

now the program wotk but it does not show my stored value it shows me
the in this case 200 becourse of

int i = pref.getInt(Int_Value, 200);

I must be missing something simple here i quess.
could someone point it out for me?



-- 
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: Shared preferences and integer values

2011-08-13 Thread Kristoffer
Here is MyPref.xml

?xml version='1.0' encoding='utf-8' standalone='yes' ?
map
int name=Int_value value=1 /
string name=String_Valuetest string/string
boolean name=Boolean_Value value=true /
long name=Long_Value value=1234567890 /
float name=Float_value value=12.5 /
/map

On 13 Aug, 09:26, Appaholics raghavs...@appaholics.in wrote:
 Most probably your Int_Value doesn't exist. In this case the number you
 specified, 200, will be assigned instead.

 Thanks

 On Sat, Aug 13, 2011 at 12:52 PM, Kristoffer kris.isak.v...@gmail.comwrote:





  Hello.

  Iam using shared preferences to store some values.

  final SharedPreferences pref = getSharedPreferences(MyPref,
  MODE_PRIVATE);

  final SharedPreferences.Editor edit = pref.edit();

  edit.putInt(Int_value, 1);
  edit.putString(String_Value, test string);
  edit.commit();

  i look in the xml file and everything is saves as it should.

  now i grabb the values:

  int i = pref.getInt(Int_Value, 200);
  String s = pref.getString(String_Value, );

  and now i wanna add it to a text label:

  I have this in top of my code

  final TextView test = (TextView) findViewById(R.id.test);

  and then if i wanna show the string everything works as it should.

  test.setText(s);

  if i try to show the int value with this

  test.setText(i);

  then my application make a force close, so i thougt that the problem
  was that i had to make the int a string so i did like this

   test.setText(Integer.toString(i));

  now the program wotk but it does not show my stored value it shows me
  the in this case 200 becourse of

  int i = pref.getInt(Int_Value, 200);

  I must be missing something simple here i quess.
  could someone point it out for me?

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

 --
 
 Raghav Sood
 CEO/Founder/Owner/Dictator/Tyrant at Appaholics (Basically all titles
 required to have complete 
 control)http://www.raghavsood.com/https://market.android.com/developer?pub=Appaholicshttp://www.appaholics.in/

-- 
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: Shared preferences and integer values

2011-08-13 Thread Kristoffer
Thanks both for pointing it out to me,
oh man iam sorry, that was a big misstake, i have looked over the code
several hours and i dident see the problem,
thanks for the help.

On 13 Aug, 10:04, skink psk...@gmail.com wrote:
 On Aug 13, 9:22 am, Kristoffer kris.isak.v...@gmail.com wrote:





  Hello.

  Iam using shared preferences to store some values.

  final SharedPreferences pref = getSharedPreferences(MyPref,
  MODE_PRIVATE);

  final SharedPreferences.Editor edit = pref.edit();

  edit.putInt(Int_value, 1);
  edit.putString(String_Value, test string);
  edit.commit();

  i look in the xml file and everything is saves as it should.

  now i grabb the values:

  int i = pref.getInt(Int_Value, 200);
  String s = pref.getString(String_Value, );

  and now i wanna add it to a text label:

  I have this in top of my code

  final TextView test = (TextView) findViewById(R.id.test);

  and then if i wanna show the string everything works as it should.

  test.setText(s);

  if i try to show the int value with this

  test.setText(i);

  then my application make a force close, so i thougt that the problem
  was that i had to make the int a string so i did like this

   test.setText(Integer.toString(i));

  now the program wotk but it does not show my stored value it shows me
  the in this case 200 becourse of

  int i = pref.getInt(Int_Value, 200);

  I must be missing something simple here i quess.
  could someone point it out for me?

 Change:

 edit.putInt(Int_value, 1) ;

 to:

 edit.putInt(Int_Value, 1) ;

 pskink



-- 
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] Save data in file or db

2011-08-12 Thread Kristoffer
Hello.

This is my first app made in eclipse (have worked with app inventor)

This is a simple app where i have two buttons and a textview.

one button will increase 1 to the number that shows in the textview
and the other button will decrease with 1.

So the question is whats the best way to handle the number that shows
in the textView field?

Is it over kill to use sqlite for this?
should i save it in i file?

-- 
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: Save data in file or db

2011-08-12 Thread Kristoffer
Thanks for the answer.

I need to save the value from sessions to sessions to i need to save
it.
so you think that i should go with SharedPreferences instead?


On 12 Aug, 11:26, Appaholics raghavs...@appaholics.in wrote:
 If you need it only once per run and can afford to throw it away and start
 again from next time then simply increment a variable. Otherwise for
 something like this SharedPreferences would do as well.

 Thanks

 On Fri, Aug 12, 2011 at 2:53 PM, Kristoffer kris.isak.v...@gmail.comwrote:





  Hello.

  This is my first app made in eclipse (have worked with app inventor)

  This is a simple app where i have two buttons and a textview.

  one button will increase 1 to the number that shows in the textview
  and the other button will decrease with 1.

  So the question is whats the best way to handle the number that shows
  in the textView field?

  Is it over kill to use sqlite for this?
  should i save it in i file?

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

 --
 
 Raghav Sood
 CEO/Founder/Owner/Dictator/Tyrant at Appaholics (Basically all titles
 required to have complete 
 control)http://www.raghavsood.com/https://market.android.com/developer?pub=Appaholicshttp://www.appaholics.in/

-- 
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: Save data in file or db

2011-08-12 Thread Kristoffer
Iam going to use SharedPreferences, thanks for the help.


On 12 Aug, 20:04, Kamil kmichal...@gmail.com wrote:
 You should definitely use SharedPreferences. It's easy to save/read
 data from prefs. Moreover, everything you save into SharedPreferences
 will be stored in XML file placed in application directory, so you can
 easy check saved value.

 On 12 Sie, 12:17, Kristoffer kris.isak.v...@gmail.com wrote:



  Thanks for the answer.

  I need to save the value from sessions to sessions to i need to save
  it.
  so you think that i should go with SharedPreferences instead?

  On 12 Aug, 11:26, Appaholics raghavs...@appaholics.in wrote:

   If you need it only once per run and can afford to throw it away and start
   again from next time then simply increment a variable. Otherwise for
   something like this SharedPreferences would do as well.

   Thanks

   On Fri, Aug 12, 2011 at 2:53 PM, Kristoffer 
   kris.isak.v...@gmail.comwrote:

Hello.

This is my first app made in eclipse (have worked with app inventor)

This is a simple app where i have two buttons and a textview.

one button will increase 1 to the number that shows in the textview
and the other button will decrease with 1.

So the question is whats the best way to handle the number that shows
in the textView field?

Is it over kill to use sqlite for this?
should i save it in i file?

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

   --
   
   Raghav Sood
   CEO/Founder/Owner/Dictator/Tyrant at Appaholics (Basically all titles
   required to have complete 
   control)http://www.raghavsood.com/https://market.android.com/developer?pub=Ap...

-- 
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: Make app fullscreen

2011-08-09 Thread Kristoffer
Hello again.

I guess that i did not make myself clear here so iam now adding a
image so that you could se what iam talking about.
This image is a screencapture of the app, and you could se that its
not using full size.

http://www.kramericasoftware.se/screenproblem.png

Hope this helps you to help me :)

On 8 Aug, 10:18, Kristoffer kris.isak.v...@gmail.com wrote:
 Hello.

 Iam new to SDK and Eclipse (i have just finished my first app in app
 inventor)
 But i feel that i wanna move on to SDK and eclipse.

 Iam going to rebuild my app that i build in app inventor, but i still
 have the same problem now with SDK and Eclipse that i had in app
 inventor.

 If i run the app on a big screen mobile (like HTC sensation) then the
 app will not use the whole screen, it leave like 2,5 cm in bottom just
 black.

 If i run the app on smaller screen (HTC Wildfire, Hero, Desire) then
 it uses the whole screen.

 I guess i have to enable something to make it fill bigger screens.
 Someone that have the time to help me?



-- 
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: Make app fullscreen

2011-08-09 Thread Kristoffer
Thanks for the help.

Iam tageting 1.6 and i added

supports-screens in my manifest file and that solved the problem.

It was easy when you pointed it out for me, thanks again for the help.

On 9 Aug, 11:10, Peter Stacey peterst6...@gmail.com wrote:
 The following might help you:

 http://developer.android.com/guide/practices/screens-support-1.5.html

 It looks like you might be targeting an early version of Android and
 as a result, the app is running in screen compatibility mode.

 Easy fix if that's the case is to target a more current version (ie.
 1.6 or later)

 Regards,

 Peter

 On Aug 8, 6:18 pm, Kristoffer kris.isak.v...@gmail.com wrote:



  Hello.

  Iam new to SDK and Eclipse (i have just finished my first app in app
  inventor)
  But i feel that i wanna move on to SDK and eclipse.

  Iam going to rebuild my app that i build in app inventor, but i still
  have the same problem now with SDK and Eclipse that i had in app
  inventor.

  If i run the app on a big screen mobile (like HTC sensation) then the
  app will not use the whole screen, it leave like 2,5 cm in bottom just
  black.

  If i run the app on smaller screen (HTC Wildfire, Hero, Desire) then
  it uses the whole screen.

  I guess i have to enable something to make it fill bigger screens.
  Someone that have the time to help me?

-- 
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] Make app fullscreen

2011-08-08 Thread Kristoffer
Hello.

Iam new to SDK and Eclipse (i have just finished my first app in app
inventor)
But i feel that i wanna move on to SDK and eclipse.

Iam going to rebuild my app that i build in app inventor, but i still
have the same problem now with SDK and Eclipse that i had in app
inventor.

If i run the app on a big screen mobile (like HTC sensation) then the
app will not use the whole screen, it leave like 2,5 cm in bottom just
black.

If i run the app on smaller screen (HTC Wildfire, Hero, Desire) then
it uses the whole screen.

I guess i have to enable something to make it fill bigger screens.
Someone that have the time to help me?

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