[android-developers] Learn DevOps - Mindmajix, New York

2017-09-01 Thread Sarah Johan
Measuring DevOps

While DevOps Training 

 may 
seem a simple integration of two teams, implementing and getting results 
from newly established DevOps roles and responsibilities is not an easy 
task. Combine an increase in the rate of change with a decrease in the 
magnitude of changes and you have a need to understand subtle changes.

Many organizations struggle to define the business goals, process, and 
organizational constructs to motivate and power team collaboration 
effectively—often due to a multitude of siloed data sources and tools used 
by development, operations, and other stakeholders in a digital business.

This is why it’s vital that you have end-to-end visibility for your 
applications, infrastructure, and digital business as a whole. With 
performance metrics that can be reviewed and shared universally, you can 
monitor your DevOps efforts and prove success at every stage. Leaders 
benefit from knowing that everyone is aligned and moving forward towards 
the same goals. And teammates can collaborate easier and quicker, with 
shared insights.
What you should measure

For your DevOps efforts to be a true success, you have to link and balance 
the goals of faster (speed of delivery), better software (high performing, 
quality software that delivers a good customer experience) to goals for 
innovation and business success. By accessing real-time and historical data 
across the entire stack—from infrastructure and application performance to 
customer experience and business metrics—you can help ensure you are 
meeting all of these objectives.

Here are just a few examples of what you should measure within your DevOps 
environment.

Business Success

Depending on your industry, company maturity, market share, and other 
variables, key performance indicators that your software could potentially 
influence include:

   - Conversion rates
   - Average revenue per user
   - Customer acquisition costs
   - Rate of customer churn
   - Recurring or incremental revenue
   - Renewals and or subscriptions


Customer Experience

It all comes back to the experience of your users. You need to link your 
business to key areas of the customer experience in order to measure how 
well you’re doing. These KPIs could include:

   - Perceived response times of key transactions
   - Frequency of key transactions
   - Number of visits per user/per week
   - User growth rates
   - Funnel/conversion rates
   - Amount of time spent in app
   - A/B test results
   - Customer satisfaction


Application Performance

Catching performance problems before they manifest (and only at scale) 
requires tracking and monitoring a number of database and application 
performance KPIs. Hopefully, your team is already focused on some or all of 
these KPIs:

   - Uptime (availability)
   - App response time
   - Database response time
   - Percentage of transaction time spent in database
   - Resource utilization
   - Database query times

*Speed*

DevOps teams need to focus on the speed of development, delivery, and 
response to issues that occur in production. Metrics to consider for 
helping you track progress and success in this area include:

   - Lead time for changes
   - Frequency of code releases
   - Mean time to resolution


Software Quality

Here are metrics that you can track to help quantify the quality of your 
software’s overall continuous improvement efforts:

   - Deployment success rate
   - App error rates
   - Incident severity
   - Outstanding bugs


For More Details Visit Mindmajix  


-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/f7c49796-c25d-4d19-9791-091591747b06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Must reboot Lollipop after write to external memory

2015-08-13 Thread Johan Appelgren
As I understand it you are supposed to notify the media database of any new 
files you add using 
http://developer.android.com/reference/android/media/MediaScannerConnection.html.
 
Android itself will only update the media database automatically on boot. 

/Johan

Den torsdag 13 augusti 2015 kl. 01:09:03 UTC+2 skrev RLScott:

 This is a new problem with Lollipop only.  My app writes to external 
 memory by building a file path name from:

   Environment.getExternalStorageDirectory().getAbsolutePath()

 But when I plug the USB into a desktop computer, the new file does not 
 show up in Explorer.  If I reboot the Lollipop Android tablet and try it 
 again, the file now shows up in Explorer on the desktop computer.  
 Furthermore, if the file already existed, then the version of the file that 
 Explorer sees is the new updated version, just as it should be.  Brand new 
 files do not show up until a reboot of Android.

 Also, this was not a problem with KitKat.  New files written by my app 
 showed up immediately on the USB-connected computer.

 Is there some way, in my app, to force new files to appear immediately to 
 the outside world?  I am writing to the root of the external memory.  This 
 is a side-loaded app, not a Market app, if that makes any difference.  It 
 has been working perfectly for 3 years, until this problem with Lollipop.

 -Robert Scott
  Hopkins, MN



-- 
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/d/optout.


[android-developers] Re: Examine the details of notifications?

2015-02-15 Thread Johan Appelgren
I think you can get most of that information with: adb shell dumpsys 
notification 

-- 
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/d/optout.


[android-developers] Re: Is it possible, that Android kills a service inside an app?

2014-12-05 Thread Johan Appelgren
What? Whether a Service runs in a separate process or not DOES NOT depend 
on whether you bind to it and/or start it using startService. That is only 
controlled by the process attribute, 
see 
http://developer.android.com/guide/topics/manifest/service-element.html#proc. 

On Friday, December 5, 2014 12:32:33 PM UTC+1, Ashik Vetrivelu wrote:

 It depends on the Service which you have. Service in android is of two 
 types:
 Bound Service and Unbounded Service. Binded Service is what is bound to 
 the activity and it lives as long as activity is running. But unbound 
 service is like a *Separate Process. The Service can still be killed by 
 Android.*To avoid this in the onDestroy() method just call the 
 BroadcastReceiver which launches the service. 
  

 On Tuesday, November 25, 2014 4:38:18 PM UTC+5:30, Oleksii Bieliaiev wrote:

 Hey guys,

 let's imagine we have an app with a service and an activity inside. Both 
 components live in a same process, our service is started (in terms of 
 Android) and a user does some interaction with an activity. Eventually our 
 app goes to background. My question is, whether is it possible, under 
 certain conditions (low memory, timeout, etc), that Android kills our 
 started service separately, without killing entire process?

 Thank you,
 Alex



-- 
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/d/optout.


[android-developers] Re: When/where should bindService/unbindService be called

2014-03-31 Thread Johan Appelgren
Why do you need to start the service at boot? That combined with what you 
write later about starting and stopping the service while your activity is 
running AND binding to it makes no sense to me. You're more likely to get a 
good answer if you explain more what you need the service for. 

http://developer.android.com/training/articles/memory.html#Services
http://developer.android.com/guide/components/services.html

On Saturday, March 29, 2014 8:48:53 PM UTC+1, dashman wrote:

 I've got a main activity that starts it's own service - if it's not 
 already started
 by the system on boot.

 Right now I'm doing the bindService() call in onStart() and 
 unbind in onStop().

 The problem is onStart() calls do not match onStop() - no 1:1 correlation.
 Activity life-cycle explains that.

 So where should I put them - onPause() onResume() ???


 Also when I call bindService() - I call startService() - incase it's not 
 already started.
 Is that ok???

 bindService(intent, context, this, Context.BIND_AUTO_CREATE );
 startService( intent );

 If it's already started by the system - it won't create another service - 
 right???





-- 
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/d/optout.


[android-developers] Windows 8.1 and adb problem

2013-10-21 Thread Johan Appelgren
How does it fail? 

Adb works fine on Windows 8.1 for me, tried with a Galaxy Nexus. 

-- 
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: close on minimise application

2013-08-16 Thread Johan Appelgren
Another activity within your app? If so, just make all of your activities 
set the timestamp in onPause to avoid just that. 

If you with going to another activity mean any activity within any app 
including things like the launcher I don't understand what you want to do. 

On Friday, August 16, 2013 8:34:29 AM UTC+2, passer wrote:

 And if user go to another activity and come back after 10 minute he should 
 enter password again?
 It is not right. 

 there shoul be correct way to distinguish minimization from going to 
 another activity.

 четверг, 15 августа 2013 г., 16:57:56 UTC+5 пользователь Johan Appelgren 
 написал:

 You could have a timestamp set in onPause that you check in 
 onCreate/onResume. If it has been too long redirect to your login activity.

 On Thursday, August 15, 2013 1:29:55 PM UTC+2, passer wrote:

 But how activity knows if user already authenticated.

 if I use static variable isAuthenticated. Value of this variable will 
 true after application minimized. and the problem remains.

 I think alone way to do this is handle of minimizing.

 среда, 14 августа 2013 г., 13:51:25 UTC+5 пользователь Piren написал:

 that's a bad idea... unless your application is just one activity, it 
 will probably piss your users off that they have to navigate it from the 
 start every time it is being backgrounded.
 take mbanzon's idea - each activity will need to request the password 
 if needed. 
 You can do it easily by extending an activity with code that handles 
 that, then having all the needed activities inherit from it.




-- 
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: close on minimise application

2013-08-15 Thread Johan Appelgren
You could have a timestamp set in onPause that you check in 
onCreate/onResume. If it has been too long redirect to your login activity.

On Thursday, August 15, 2013 1:29:55 PM UTC+2, passer wrote:

 But how activity knows if user already authenticated.

 if I use static variable isAuthenticated. Value of this variable will 
 true after application minimized. and the problem remains.

 I think alone way to do this is handle of minimizing.

 среда, 14 августа 2013 г., 13:51:25 UTC+5 пользователь Piren написал:

 that's a bad idea... unless your application is just one activity, it 
 will probably piss your users off that they have to navigate it from the 
 start every time it is being backgrounded.
 take mbanzon's idea - each activity will need to request the password if 
 needed. 
 You can do it easily by extending an activity with code that handles 
 that, then having all the needed activities inherit from it.




-- 
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 Johan Appelgren
Have you tried analyzing your app with tools like ddms? 

http://developer.android.com/tools/debugging/ddms.html
http://android-developers.blogspot.se/2011/03/memory-analysis-for-android.html

On Monday, July 29, 2013 8:22:12 AM UTC+2, 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 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: why we prefer Inexact Alarms ?

2013-07-17 Thread Johan Appelgren
Says why right there in the documentation. 

These alarms are more power-efficient than the strict recurrences supplied 
by setRepeating(int, long, long, PendingIntent), since the system can 
adjust alarms' phase to cause them to fire simultaneously, avoiding waking 
the device from sleep more than necessary.
http://developer.android.com/reference/android/app/AlarmManager.html#setInexactRepeating(int,
 
long, long, android.app.PendingIntent)

On Wednesday, July 17, 2013 8:57:08 AM UTC+2, Ashish Sharma wrote:

 Hi,

 In android i found to set repeating task with Alarm Manager as compare to 
 service is a better approach..

 but can any body explain what is *Inexact Alarms and why we prefer it.*



-- 
-- 
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] APK Re-Install Won't Clear Data

2013-07-05 Thread Johan Appelgren
Where do you store data and what version of Android do you test on? 

-- 
-- 
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] Service is restarted after ANR, OutOfMemoryError, native crashes, etc inspite of Service.START_NOT_STICKY

2013-07-03 Thread Johan Appelgren
Do you bind to the service? 

-- 
-- 
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: Service onDestroy() not being called...

2013-05-03 Thread Johan Appelgren
In addition to binding to the service, do you use startService? If you do, 
you must also call stopService/stopSelf, just unbinding and calling 
stopForeground is not enough. 

On Thursday, May 2, 2013 9:07:07 PM UTC+2, Larry Meadors wrote:

 I have a bound service that I'm using to play audio. 

 An activity binds to the service in onResume() and sets the service as 
 a foreground service. 

 The onPause() checks to see if the media player on the service is 
 playing, and if it is NOT, calls stopForeground(true), then unbinds 
 (in either case - playing or not). 

 I've got code in the onDestroy with log calls, but while other logs 
 messages from the service show up...it doesn't appear that the 
 onDestroy() is getting called. 

 Am I misunderstanding the lifecycle here, or is there something I can 
 check to see why the service remains running? 

 Larry 


-- 
-- 
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] Android kills my Thread created by Service

2013-04-23 Thread Johan Appelgren
Even if you have a foregrounded service the process might get killed, and 
restarted if the service is configured for it. An example of this is the 
music app on my Galaxy Nexus, it gets killed every now and then if I listen 
to music and use Flipboard or Chrome beta, memory intensive apps. 

On Tuesday, April 23, 2013 2:48:33 PM UTC+2, Kristopher Micinski wrote:

 All Android apps have this behavior: eventually they get kicked out of 
 memory when the user hasn't used them in a while.  This is completely 
 normal: you aren't *supposed* to have a program that lasts forever. 
 If you want this, you should have a foregrounded service. 

 Kris 

 On Tue, Apr 23, 2013 at 7:22 AM, Turim turim_...@hotmail.comjavascript: 
 wrote: 
  I am developing a simple GPS tracker. But i have a problem. When starts 
 the 
  Service, i create a Thread that get de localization, time after time. 
 The 
  problem is after long time (about hours), the Thread is stoped. I dont 
 know 
  why. 
  
  
  How do i create a service/thread long time. I need that thread never 
  stopped, or the service be recreated. 
  
  Anybody help 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-d...@googlegroups.comjavascript: 
  To unsubscribe from this group, send email to 
  android-developers+unsubscr...@googlegroups.com javascript: 
  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 javascript:. 
  For more options, visit https://groups.google.com/groups/opt_out. 
  
  


-- 
-- 
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: New activity when I lock my screen

2013-01-30 Thread Johan Appelgren
What error do you get? 

On Wednesday, January 30, 2013 11:48:59 AM UTC+1, Davide Moriello wrote:

 Hello, I'm developing an android app for some time now. Everything is 
 going well. When I close my app with the home button and I reopen it there 
 aren't any problems or crashes.
 But, when I have my app open and I lock my screen the app create a new 
 istance of the activity and call again onCreate when the screen is 
 locked... so crash!

 the code of my activity is here
 http://pastebin.com/j1mTRUnB


 What can this be? Any suggestion? Thank you a lot =)


-- 
-- 
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: Knockoff copy of my app on Google Play.

2013-01-28 Thread Johan Appelgren
Just decompile, add ad activity, change manifest and recompile. Haven't tried 
but can probably be automated for most apps.

-- 
-- 
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, send email to 
android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: How do you show 'Are you sure you want to quit' dialog?

2012-11-28 Thread Johan Appelgren
You'd probably want to persist data even if you have a confirmation dialog on 
back since the user might task switch or press home. 

-- 
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: newbie question: Open settings on desktop icon for wallpaper

2012-11-25 Thread Johan Wasserman
Apologies for being impatient, I'm pulling my last hair out on this issue. 
 To my defence I didn't bump after 3 hours, it was more like 27 hours 
(not sure if living in Australia where the time is now 9am on the 26th of 
Sept has anything to do with the thought that I bumped after 3 hours, 
anyway, there's no excuse for bumping, my patience got the best of me).

Back to the matter at hand, I'm using the Tutorial (found 
here http://www.vogella.com/articles/AndroidLiveWallpaper/article.html), as 
a basis for my wallpaper.  It has two activities, LiveWallpaperSettings 
extends PreferenceActivity and MainActivity extends Activity.

I have the following activities (after setting up the stock standard 
wallpaperservice):
activity android:label=@string/livewallpaper_settings
  android:name=com.clock.LiveWallpaperSettings
android:theme=@style/AppTheme
android:exported=true
android:icon=@drawable/clockicon
/activity

activity
android:name=com.clock.MainActivity
android:screenOrientation=sensor
android:label=@string/app_name

android:theme=@android:style/Theme.Light.WallpaperSettings 
intent-filter
action android:name=android.intent.action.MAIN /
category android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity

When I move the filters to the Settings activity, the wallpaper doesn't 
launch from Settings, it crashes with Unfortunately Clock Wallpaper has 
stopped.  
No matter where the intent filter is, when I click on the icon for the 
wallpaper, it toasts Application is not installed.  Just note when I say 
click on the icon I mean the icon in the Apps folder, not the wallpaper 
itself under Settings.  Clicking the wallpaper under settings works 
perfectly with the activities defined as above.


On Saturday, November 24, 2012 7:56:08 PM UTC+11, Johan Wasserman wrote:

 Hi,
 I wrote a live wallpaper and would like to open the settings when clicking 
 on the App icon.  It should still be set from the settings page, but 
 clicking the icon in the Apps page open the Settings for the wallpaper. 
  This may be a handy shortcut to the live wallpaper settings instead of 
 navigating through Settings - Display - Home screen wallpaper - etc, etc 
 to get there.

 Anyone know if it's possible, and what I need to do do make it happen?

 Thanks,
 J.


-- 
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] canvas.drawBitmap draws over screen image instead of replacing screen image

2012-11-25 Thread Johan
I have some strange behaviour when repainting the screen with my live 
wallpaper.  I'm scaling an image and drawing it to the screen, but on each 
draw (as the image is scaled smaller than the previous draw), I can still 
see the previous image below the new image.
How do I clear the previous image out so that only the new scaled image is 
displayed?

This is my code:

private final Runnable mDraw = new Runnable() {
public void run() {
draw();
}
};

void draw() {
SurfaceHolder holder = getSurfaceHolder();
Canvas canvas = null;
try {
canvas = holder.lockCanvas();
if(canvas != null) {
this.paintScreen(canvas);
}
}finally {
if(canvas != null) {
holder.unlockCanvasAndPost(canvas);
}
}
mHandler.removeCallbacks(mDraw);
if (mVisible) {
mHandler.postDelayed(mDraw, 6);
}
}

Every minute my paintSurface function scales a bitmap (image loaded from 
resources), then uses canvas.drawBitmap to put the image on the screen.  As 
I understand from the documentation, holde.lockCanvas()is not supposed to 
contain the image currently on the screen and every pixel has to be 
drawn... this doesn't seem to be the case since the previous pixels are 
obviously under the new pixels.

Thanks,
J
(26 Sept '12 - 10:45 AM)

-- 
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] canvas.drawBitmap draws over screen image instead of replacing screen image

2012-11-25 Thread Johan
Thanks for the hint!  Work's perfectly.

 paint.setXfermode(new PorterDuffXfermode(Mode.CLEAR));
canvas.drawPaint(paint);


On Monday, November 26, 2012 11:31:12 AM UTC+11, Romain Guy (Google) wrote:

 Surfaces are double (or even triple) buffered. You are indeed not getting 
 in your canvas what's currently on screen but what was on screen a frame 
 ago. The easiest way to clear the surface is to call canvas.drawColor(0, 
 PorterDuff.Mode.CLEAR) (you can also use 0xff00, PorterDuff.Mode.SRC).


 On Sun, Nov 25, 2012 at 3:42 PM, Johan johan.w...@gmail.com javascript:
  wrote:

 I have some strange behaviour when repainting the screen with my live 
 wallpaper.  I'm scaling an image and drawing it to the screen, but on each 
 draw (as the image is scaled smaller than the previous draw), I can still 
 see the previous image below the new image.
 How do I clear the previous image out so that only the new scaled image 
 is displayed?

 This is my code:

 private final Runnable mDraw = new Runnable() {
 public void run() {
 draw();
 }
 };

 void draw() {
 SurfaceHolder holder = getSurfaceHolder();
  Canvas canvas = null;
 try {
 canvas = holder.lockCanvas();
  if(canvas != null) {
 this.paintScreen(canvas);
 }
  }finally {
 if(canvas != null) {
 holder.unlockCanvasAndPost(canvas);
  }
 }
 mHandler.removeCallbacks(mDraw);
 if (mVisible) {
  mHandler.postDelayed(mDraw, 6);
 }
 }

 Every minute my paintSurface function scales a bitmap (image loaded from 
 resources), then uses canvas.drawBitmap to put the image on the screen.  As 
 I understand from the documentation, holde.lockCanvas()is not supposed to 
 contain the image currently on the screen and every pixel has to be 
 drawn... this doesn't seem to be the case since the previous pixels are 
 obviously under the new pixels.

 Thanks,
 J
 (26 Sept '12 - 10:45 AM)

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




 -- 
 Romain Guy
 Android framework engineer
 roma...@android.com javascript:

  

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

Re: [android-developers] Re: newbie question: Open settings on desktop icon for wallpaper

2012-11-25 Thread Johan
Yea it seems I bs'd on the fact that it errors when I move the intent 
filters to the Settings activity (or I may have changed something in the 
mean time that makes it work).  Only thing is, now the icon dissipated 
 I can only access the wallpaper via Settings.  If I can figure out how to 
get the wallpaper icon back in the Apps folder I can test if it opens the 
Settings when I click on it.

Always something aint there, lol.

On Monday, November 26, 2012 12:35:51 PM UTC+11, TreKing wrote:


 On Sun, Nov 25, 2012 at 5:19 PM, Johan Wasserman 
 johan.w...@gmail.comjavascript:
  wrote:

 To my defence I didn't bump after 3 hours, it was more like 27 hours


 I thought that math was a little funky :) 
  

 I have the following activities (after setting up the stock standard 
 wallpaperservice):
  activity android:label=@string/livewallpaper_settings
   android:name=com.clock.LiveWallpaperSettings
  android:theme=@style/AppTheme
 android:exported=true
 android:icon=@drawable/clockicon
  /activity

 activity
 android:name=com.clock.MainActivity
 android:screenOrientation=sensor
 android:label=@string/app_name
 
 android:theme=@android:style/Theme.Light.WallpaperSettings 
 intent-filter
 action android:name=android.intent.action.MAIN /
 category android:name=android.intent.category.LAUNCHER 
 /
 /intent-filter
 /activity


 I'm curious why you have two Activities? I know nothing about live 
 wallpapers, but having one called LiveWallpaperSettings and then one that 
 is actually the one opened in the system Settings sounds ... confusing ...
  

 When I move the filters to the Settings activity, the wallpaper doesn't 
 launch from Settings, it crashes with Unfortunately Clock Wallpaper has 
 stopped.


 You ran this in the debugger? Nothing more from LogCat?
  

 No matter where the intent filter is, when I click on the icon for the 
 wallpaper, it toasts Application is not installed.


 Well, that's definitely weird as the Main + Launcher combo should tell the 
 system to open the specified Activity from the Home Launcher.

 Have you searched the webs for this problem? (like 'wallpaper application 
 not installed ' (note the quotes))

 Have you checked b.android.com for a possible bug?


 -
 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

Re: [android-developers] canvas.drawBitmap draws over screen image instead of replacing screen image

2012-11-25 Thread Johan
Thanks, yea I set everything in an init function, outside of the main draw 
function (that puts everything on screen).  Learned a lesson there when 
setting too many things I ran out of memory (I set my emulator for only 
512MB to help me make sure I'm aware of memory usage in my app).

Thanks for all your great help!

On Monday, November 26, 2012 12:53:20 PM UTC+11, Romain Guy (Google) wrote:

 You should avoid creating a new paint every time though, which is why I 
 mentioned the drawColor() alternative.


 On Sun, Nov 25, 2012 at 4:57 PM, Johan johan.w...@gmail.com javascript:
  wrote:

 Thanks for the hint!  Work's perfectly.

  paint.setXfermode(new PorterDuffXfermode(Mode.CLEAR));
 canvas.drawPaint(paint);


 On Monday, November 26, 2012 11:31:12 AM UTC+11, Romain Guy (Google) 
 wrote:

 Surfaces are double (or even triple) buffered. You are indeed not 
 getting in your canvas what's currently on screen but what was on screen a 
 frame ago. The easiest way to clear the surface is to call 
 canvas.drawColor(0, PorterDuff.Mode.CLEAR) (you can also use 0xff00, 
 PorterDuff.Mode.SRC).


 On Sun, Nov 25, 2012 at 3:42 PM, Johan johan.w...@gmail.com wrote:

 I have some strange behaviour when repainting the screen with my live 
 wallpaper.  I'm scaling an image and drawing it to the screen, but on each 
 draw (as the image is scaled smaller than the previous draw), I can still 
 see the previous image below the new image.
 How do I clear the previous image out so that only the new scaled image 
 is displayed?

 This is my code:

 private final Runnable mDraw = new Runnable() {
 public void run() {
 draw();
 }
 };

 void draw() {
 SurfaceHolder holder = getSurfaceHolder();
  Canvas canvas = null;
 try {
 canvas = holder.lockCanvas();
  if(canvas != null) {
 this.paintScreen(canvas);
 }
  }finally {
 if(canvas != null) {
 holder.unlockCanvasAndPost(**canvas);
  }
 }
 mHandler.removeCallbacks(**mDraw);
 if (mVisible) {
  mHandler.postDelayed(mDraw, 6);
 }
 }

 Every minute my paintSurface function scales a bitmap (image loaded 
 from resources), then uses canvas.drawBitmap to put the image on the 
 screen.  As I understand from the documentation, holde.lockCanvas()is not 
 supposed to contain the image currently on the screen and every pixel has 
 to be drawn... this doesn't seem to be the case since the previous pixels 
 are obviously under the new pixels.

 Thanks,
 J
 (26 Sept '12 - 10:45 AM)

 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@**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=enhttp://groups.google.com/group/android-developers?hl=en




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

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




 -- 
 Romain Guy
 Android framework engineer
 roma...@android.com javascript:

  

-- 
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: newbie question: Open settings on desktop icon for wallpaper

2012-11-25 Thread Johan
Yea that Icon keeps toasting me with Application is not Installed.

I added 

setContentView(R.layout.activity_main);

to the onCreate function of LiveWallpaperSettings.java, but now the 
wallpaper stops with the following error:

11-26 02:18:52.815: E/AndroidRuntime(14345): FATAL EXCEPTION: main
11-26 02:18:52.815: E/AndroidRuntime(14345): java.lang.RuntimeException: 
Unable to start activity 
ComponentInfo{com.clock/com.clock.LiveWallpaperSettings}: 
java.lang.RuntimeException: Your content must have a ListView whose id 
attribute is 'android.R.id.list'



On Saturday, November 24, 2012 7:56:08 PM UTC+11, Johan wrote:

 Hi,
 I wrote a live wallpaper and would like to open the settings when clicking 
 on the App icon.  It should still be set from the settings page, but 
 clicking the icon in the Apps page open the Settings for the wallpaper. 
  This may be a handy shortcut to the live wallpaper settings instead of 
 navigating through Settings - Display - Home screen wallpaper - etc, etc 
 to get there.

 Anyone know if it's possible, and what I need to do do make it happen?

 Thanks,
 J.


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

Re: [android-developers] Re: newbie question: Open settings on desktop icon for wallpaper

2012-11-25 Thread Johan
There's not many places it can go, or am I wrong?

activity android:label=@string/livewallpaper_settings
  android:name=com.clock.LiveWallpaperSettings
android:theme=@style/AppTheme
android:exported=true
android:icon=@drawable/clockicon
 intent-filter
 action android:name=android.intent.action.MAIN /
 category android:name=android.intent.category.LAUNCHER 
/
 /intent-filter
/activity

On Monday, November 26, 2012 1:25:00 PM UTC+11, TreKing wrote:

 On Sun, Nov 25, 2012 at 8:57 PM, Johan johan.w...@gmail.com javascript:
  wrote:

 Only thing is, now the icon dissipated  I can only access the 
 wallpaper via Settings.


 That sounds like the CATEGORY_LAUNCHER flag is missing or in the wrong 
 place.


 -
 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

Re: [android-developers] Re: newbie question: Open settings on desktop icon for wallpaper

2012-11-25 Thread Johan
getting seriously confusing... Back to basics:

I have a live wallpaper, it has an icon in the Apps folder.  When I click 
on it it toasts me with Application is not Installed.  How do I get it to 
open anything from clicking the icon.
I have the following in the manifest and it does nothing for clicking the 
icon (not even an entry in LogCat) while everything else still works 
perfectly fine:
activity
 android:name=com.clock.MainActivity
 android:screenOrientation=sensor
 android:label=@string/app_name
 android:theme=@android:style/Theme.Light.WallpaperSettings 
 intent-filter
 action android:name=android.intent.action.MAIN /
 category android:name=android.intent.category.LAUNCHER 
/
 /intent-filter
 /activity

Keep in mind it's a live wallpaper activated from Settings, but I would 
like to open the preferences from the icon as a shortcut.

On Monday, November 26, 2012 1:25:00 PM UTC+11, TreKing wrote:

 On Sun, Nov 25, 2012 at 8:57 PM, Johan johan.w...@gmail.com javascript:
  wrote:

 Only thing is, now the icon dissipated  I can only access the 
 wallpaper via Settings.


 That sounds like the CATEGORY_LAUNCHER flag is missing or in the wrong 
 place.


 -
 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] newbie question: Open settings on desktop icon for wallpaper

2012-11-24 Thread Johan Wasserman
Hi,
I wrote a live wallpaper and would like to open the settings when clicking 
on the App icon.  It should still be set from the settings page, but 
clicking the icon in the Apps page open the Settings for the wallpaper. 
 This may be a handy shortcut to the live wallpaper settings instead of 
navigating through Settings - Display - Home screen wallpaper - etc, etc 
to get there.

Anyone know if it's possible, and what I need to do do make it happen?

Thanks,
J.

-- 
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: newbie question: Open settings on desktop icon for wallpaper

2012-11-24 Thread Johan Wasserman
Really? No one? And I thought this is the place where the clever people are 
to come for advice...

On Saturday, November 24, 2012 7:56:08 PM UTC+11, Johan Wasserman wrote:

 Hi,
 I wrote a live wallpaper and would like to open the settings when clicking 
 on the App icon.  It should still be set from the settings page, but 
 clicking the icon in the Apps page open the Settings for the wallpaper. 
  This may be a handy shortcut to the live wallpaper settings instead of 
 navigating through Settings - Display - Home screen wallpaper - etc, etc 
 to get there.

 Anyone know if it's possible, and what I need to do do make it happen?

 Thanks,
 J.


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

[android-developers] How to lock Live Wallpaper in Landscape?

2012-11-20 Thread Johan Wasserman
I'm really stuck on this issue and would appreciate any help very much.
I have searched and tried everything I could find on this topic, and still 
have not been able to lock my Live Wallpaper to Landscape. An Earth map 
forms the basis of my wallpaper, so you can see why it needs to be oriented 
to fill the longest axis of the screen side to side.  The wallpaper also 
requires a three image overlay with clipping, so I'm drawing directly to 
the Canvas using .drawBitmap, and setting the .clipPath. For some reason 
using .rotate on the Canvas is ignored. 

Due to the nature of the wallpaper I can only rotate after the image have 
been drawn. Being a live Wallpaper, I cannot use remapCoordinateSystem 
since it only allows one Activity for setting the wallpaper and 
android:screenOrientation=landscape does not work for the same reason 
remapCoordinateSystem does not work. 

I can very easily determine the current orientation, and if the natural 
orientation for the device is portrait (typically phones) or landscape 
(typically tablets) by comparing the orientation with the screen dimensions 
(width  height  rotation = 0 or 180, it's a tablet) Now all I need to do 
is figure a way to lock the screen in the correct orientation.

Is there any other way to ensure the orientation of a Live Wallpaper will 
always be in Landscape mode?

-- 
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: Get the calling thread's id

2012-11-19 Thread Johan Appelgren
You can get the thread id using 
Thread.getId() 
http://developer.android.com/reference/java/lang/Thread.html#getId()

On Monday, November 19, 2012 10:14:27 AM UTC+1, AndroidCompile wrote:

 Hi,
 Is it possible to retrieve the id of a thread that called a certain 
 function? (assuming this function can be called from several threads)
 I know that it is possible to ask a Binder object which Process had called 
 it, but is it also possible with threads from the same process?

 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: Remote resources

2012-10-31 Thread Johan Appelgren
Have you looked at using Multiple APKs? 
http://developer.android.com/guide/google/play/publishing/multiple-apks.html

Wont solve the overhead of managing multiple builds, but at least you wont 
disperse social promotion. 

On Wednesday, October 31, 2012 2:35:11 PM UTC+1, Fran wrote:

 Hi there, 

 I have a real problem when providing different resources for different 
 displays, according to their density. Putting all the needed graphics on 
 the same apk file makes it really big, and most of the graphics will not 
 be used by the device where they are installed never. 

 I have seen that what some developers does is to have an HD separated 
 version of their app, but this implies more development effort and 
 dispersing social promotion of the game (user's ratings, position on the 
 market, social network links, etc.) 

 I think the best approach should be something that keeps the minimal 
 needed resources on the apk, and during the first run of the app takes 
 care of downloading the ones that fits the display of the device. 

 This has some additional difficulties, but I do not want to write a 
 thesis on this, just to ask if someones knows something that does this 
 yet written, before I start reinventing the wheel for my own projects. 

 Best regards, 



-- 
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: MEDIA_MOUNTED broadcast not being recieved when Application is installed on SD card

2012-10-04 Thread Johan Appelgren
If you want your app to start at boot then you should not allow it to be 
installed on external storage. 

http://developer.android.com/guide/topics/data/install-location.html#ShouldNot

On Thursday, October 4, 2012 1:58:22 PM UTC+2, Juned Khan wrote:

 How do i start my application on startup in case when application is 
 installed on SD card? If i application is installed on Internal memory 
 then  using `BOOT_COMPLETED` completed broadcast we can achieve our 
 requirements but this BOOT_COMPLETED intent is broadcasts before the media 
 is mounted so we can not use this broadcast.

 What i tried so far is, i used the another intent which is `MEDIA_MOUNTED` 
 but don't know why broadcast is not being received.

 **Here is my code**:br AndroidManifest.xmlbr
  

 receiver
 android:name=.ui.Receiver
 android:enabled=true 
 intent-filter
 action 
 android:name=android.intent.action.MEDIA_MOUNTED /
 data android:scheme=file /
 /intent-filter
 intent-filter
 action 
 android:name=android.intent.action.BOOT_COMPLETED /
 action 
 android:name=android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE /
 action 
 android:name=android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE /
 category 
 android:name=android.intent.category.DEFAULT /
 /intent-filter
 intent-filter
 action 
 android:name=android.intent.action.PACKAGE_REPLACED /
 
 data android:scheme=package /
 data android:path=org.sipchat.sipua /
 /intent-filter
 /receiver

 **Receiver.java**br

 public void onReceive(Context context, Intent intent) {
 String intentAction = intent.getAction();
 if (intentAction.equals(Intent.ACTION_BOOT_COMPLETED)) {
 Toast.makeText(context, BOOT Completed, 
 Toast.LENGTH_LONG).show();
 on_vpn(false);
 engine(context).register();
 } else if (intentAction.equals(Intent.ACTION_MEDIA_MOUNTED)) {
 Toast.makeText(context, Media is Mounted, 
 Toast.LENGTH_LONG)
 .show();
 engine(context).register();
 } else if 
 (intentAction.equals(ConnectivityManager.CONNECTIVITY_ACTION)
 || 
 intentAction.equals(ACTION_EXTERNAL_APPLICATIONS_AVAILABLE)
 || intentAction
 
 .equals(ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE)
 || 
 intentAction.equals(Intent.ACTION_PACKAGE_REPLACED)) {
 engine(context).register();}}

 Any help and suggestion will be appreciatedbr
 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: Isolated database tests

2012-09-29 Thread Karl-Johan Jensen
Sorry for resurrecting the thread but I was unable to find answer other 
place than the docs. 

You can indeed make isolated database tasts by keeping a reference to your 
IsolatedContext and calling deleteDatabase(name).


private DatabaseManager manager = null;
 private IsolatedContext isolate;
 @Override
 protected void setUp() throws Exception {
 super.setUp();

 if(isolate == null)
 isolate = new IsolatedContext(null, mContext);
 if(manager == null) 
 manager = new DatabaseManager(isolate);
 System.out.println(this.getClass().getSimpleName() +   setting new 
 isolatedcontext);

 }
 @Override
 protected void tearDown() throws Exception {
 super.tearDown();
 isolate.deleteDatabase( databaseName  );
 }

 

-- 
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: Request to Separate Permissions for Read Phone State and Read Phone Identity

2012-08-17 Thread Johan Appelgren
For a lot of apps the life cycle events for activities are enough, no need 
bother with whether the user is in a call or not. And isn't the audio focus 
mechanism enough for most media/music apps unless you need to support API 
level  8? 

If you worry about IMEI, what about Wifi MAC? And what about the phone 
numbers of those you are in a call with? =)

On Friday, August 17, 2012 2:17:30 AM UTC+2, CapnShiner wrote:

 I do not understand why permissions are still combined for phone state and 
 identity. I have no problem letting an app see that my phone is ringing or 
 that I'm on a call. I understand that many apps need this permission so 
 that they do not prevent normal operation of the device and its ability to 
 make and receive calls. On the other hand, very few apps need to know the 
 phone's MEID, which is personally identifiable information. I see no reason 
 why anyone should have to share such sensitive information just to install 
 the latest tower defense game. Permissions with varying degrees of 
 sensitivity or security should not be grouped together.

-- 
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] Non sticky service gets recreated (indefinetly?)

2012-08-12 Thread Johan Appelgren
So it looks like I'm missing something about how to unbind from a service. 
I thought that calling unbindService with the same ServiceConnection 
instance would be enough. Looking at the output from dumpsys it looks only 
partially unbound or something. I guess this explains why it is restarted. 
How do I completely unbind?

adb shell dumpsys activity services com.example.service
ACTIVITY MANAGER SERVICES (dumpsys activity services)
  Active services:
  * ServiceRecord{426c09c0 com.example.service/.MainService}
intent={cmp=com.example.service/.MainService}
packageName=com.example.service
processName=com.example.service
baseDir=/data/app/com.example.service-1.apk
dataDir=/data/data/com.example.service
app=ProcessRecord{42183390 8027:com.example.service/u0a97}
createTime=-1m2s860ms lastActivity=-1m2s857ms
executingStart=-3s22ms restartTime=-1m2s860ms
startRequested=true stopIfKilled=true callStart=true lastStartId=1
Bindings:
* IntentBindRecord{426dda38}:
  intent={cmp=com.example.service/.MainService}
  binder=android.os.BinderProxy@42610298
  requested=true received=true hasBound=false doRebind=false

On Saturday, August 11, 2012 8:21:07 PM UTC+2, Dianne Hackborn wrote:

 Unless the service has something bound to it or it is started, it will not 
 be re-created.

 You can look at the service state with adb shell dumpsys activity 
 services or adb shell dumpsys activity service package_name or 
 service_name.  If your service is listed there, it will show you what its 
 current state is -- what is bound to it, whether it is started, etc.

 On Fri, Aug 10, 2012 at 2:26 PM, Johan Appelgren 
 johan.a...@gmail.comjavascript:
  wrote:

 You're right that I'm not understanding something here, most likely it is 
 something really obvious too. :(

 As I wrote, my understanding of what you describe is not the behavior I'm 
 seeing with my test app on my Galaxy Nexus with Android 4.1.1 nor the 4.1.1 
 emulator image. After I've unbound from the service, in my test I do this 
 in the activity's onPause, when the app process is killed, it and the 
 service is restarted. Then after that the process and service is killed and 
 restarted every now and then, without starting the activity or any calls to 
 startService or bindService made by any code in my test app. It starts 
 quicker if I start a couple of different games to put some memory pressure 
 on the system.

 Not even stopping the cached process in the Cached processes list stops 
 it, it is restarted a little while after. Only going to the Downloaded list 
 and pressing the Force stop button stops the stop/restart cycle. 

 Perhaps someone could look at my dummy app code and point out what I'm 
 doing wrong. If someone does, I'm sorry for most likely wasting your time. 

 public class MainActivity extends Activity {

 @SuppressWarnings(unused)
 private int[] mDummyData = new int[3 * 1024 * 1024];
  private final String TAG = MainActivity;
  private boolean mBound;
  private boolean mCalledBind;
 private boolean mStarted;
  private final ServiceConnection mConnection = new 
 ServiceConnection() {

 @Override
 public void onServiceConnected(ComponentName className, IBinder 
 service) {
 Log.d(TAG, onServiceConnected);
 mBound = true;
 }

 @Override
 public void onServiceDisconnected(ComponentName arg0) {
 Log.d(TAG, onServiceDisconnected);
 }
 };

 public MainActivity(){
 Log.d(TAG, ctor);
 }
 
 @Override
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);

 Intent intent = new Intent(this, MainService.class);

 Log.d(TAG, onCreate);
 
 if (!mStarted) {
 Log.d(TAG, startService);
  startService(intent);
 mStarted = true;
 }
 
 if (!mBound  !mCalledBind) {
 Log.d(TAG, bindService);
 bindService(intent, mConnection, BIND_AUTO_CREATE);
 mCalledBind = true;
 }
 }
 
 @Override
 protected void onPause() {
 Log.d(TAG, onPause);
 
 if (mBound) {
 Log.d(TAG, unbindService);
 unbindService(mConnection);
 mBound = false;
  mCalledBind = false;
 }
 
 super.onPause();
 }
 
 @Override
 protected void onDestroy() {
 Log.d(TAG, onDestroy);
 
 super.onDestroy();
 }
 }

 public class MainService extends Service {

 @SuppressWarnings(unused)
  private int[] mDummyData = new int[1024*1024];
  private static final String TAG = MainService;
  private final IBinder mBinder = new LocalBinder();
  public class LocalBinder extends Binder {
  MainService getService() {
 return MainService.this;
 }
 }
  @Override
 public IBinder onBind(Intent arg0) {
 Log.d(TAG, onBind

Re: [android-developers] Non sticky service gets recreated (indefinetly?)

2012-08-10 Thread Johan Appelgren
Still occupies some amount of memory though, and the service's onCreate 
might not be cheap. 

Anyways, I guess this is one of those little undocumented things you just 
have to learn. Do not rely on START_NOT_STICKY if you both start and bind 
to a service if you don't want the service to stay around forever as a 
cached process after you've unbound it. 

On Thursday, August 9, 2012 7:15:09 PM UTC+2, Dianne Hackborn wrote:

 Binding to a service can only make that service's process as important as 
 the process of the client binding to it.  If the client process is in the 
 background, it can't bring the service up beyond the background, so it 
 doesn't count as a running process but a cached process.

 On Thu, Aug 9, 2012 at 3:09 AM, Johan Appelgren 
 johan.a...@gmail.comjavascript:
  wrote:

 Ok, thanks. But shouldn't it (non-sticky service with no active 
 connections, nothing is bound to it) show up in the Running Services view 
 when it has been restarted? Or is that only for sticky services?


 On Thursday, August 9, 2012 8:35:50 AM UTC+2, Dianne Hackborn wrote:

 Binding and starting are completely orthogonal things.  You bind to a 
 service to establish a persistent connection to it.  You start a service to 
 have it run for some undefined amount of time separately from the caller. 
  A service needs to remain created as long as it is being asked to do 
 either of these things.

 If you don't want it to stay created, either don't bind to it when you 
 don't want it around, or don't use BIND_AUTO_CREATE so you aren't forcing 
 it to remain created while bound to it.

 On Wed, Aug 8, 2012 at 10:46 PM, Johan Appelgren 
 johan.a...@gmail.comwrote:

 So START_NOT_STICKY has no effect once I've bound to it even if I 
 unbind? I must explicitly use stopService if the service has ever been 
 bound to even if there are no more connection? 


 On Thursday, August 9, 2012 2:54:41 AM UTC+2, Dianne Hackborn wrote:

 If you bind to it with BIND_AUTO_CREATE, you are saying you want the 
 service to be created as long as you are bound to it.

 From the documentation:

 A service can be both started and have connections bound to it. In 
 such a case, the system will keep the service running as long as either 
 it 
 is started or there are one or more connections to it with the 
 Context.BIND_AUTO_CREATE flag.

 http://developer.android.com/**r**eference/android/app/Service.**h**
 tml http://developer.android.com/reference/android/app/Service.html

 On Wed, Aug 8, 2012 at 1:52 PM, Johan Appelgren 
 johan.a...@gmail.comwrote:

 If I have a simple service that returns START_NOT_STICKY in 
 onStartCommand and I both start it explicitly (startService) and bind to 
 it 
 (bindService) in onCreate of my activity the service gets recreated 
 after 
 it has been killed over and over again. I unbind the service in onPause 
 of 
 my activity. 

 Logcat shows that the service is scheduled for restart and is 
 restarted over and over again. The service is not shown as running after 
 it's been recreated in Settings - Apps - Running. 

 08-08 21:57:25.081 D/ExampleActivity(23715): onPause
 08-08 22:11:44.480 W/ActivityManager(  306): Scheduling restart of 
 crashed service com.example.service/.**MainServi**ce in 5000 ms
  08-08 22:11:49.519 I/ActivityManager(  306): Start proc 
 com.example.strangeservice for service com.example.service/.**
 MainServi**ce
 08-08 22:11:49.597 D/ExampleService(24079): onCreate
  08-08 22:27:38.551 I/ActivityManager(  306): No longer want 
 com.example.service (pid 24079): hidden #16
 08-08 22:27:38.574 W/ActivityManager(  306): Scheduling restart of 
 crashed service com.example.service/.**MainServi**ce in 5000ms
 08-08 22:27:43.629 I/ActivityManager(  306): Start proc 
 com.example.strangeservice for service com.example.service/.**
 MainServi**ce: pid=24401 uid=10101 gids={1028}
 08-08 22:27:43.785 D/ExampleService(24401): onCreate
 08-08 22:49:59.871 I/ActivityManager(  306): Process 
 com.example.service (pid 24401) has died.
 08-08 22:49:59.871 W/ActivityManager(  306): Scheduling restart of 
 crashed service com.example.service/.**MainServi**ce in 5000ms
 08-08 22:50:04.934 I/ActivityManager(  306): Start proc 
 com.example.strangeservice for service com.example.service/.**
 MainServi**ce: pid=24857 uid=10101 gids={1028}
 08-08 22:50:05.051 D/ExampleService(24857): onCreate

 I thought START_NOT_STICKY meant that once it gets killed by Android 
 it wont be restarted unless I explicitly start it again. Or does binding 
 to 
 a service override that and make the service sticky?

 I've been testing this on a Galaxy Nexus with stock Android 4.1.1.

  -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@**googlegroups.com

 To unsubscribe from this group, send email to
 android-developers+**unsubscribe**@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group

Re: [android-developers] Non sticky service gets recreated (indefinetly?)

2012-08-10 Thread Johan Appelgren
You're right that I'm not understanding something here, most likely it is 
something really obvious too. :(

As I wrote, my understanding of what you describe is not the behavior I'm 
seeing with my test app on my Galaxy Nexus with Android 4.1.1 nor the 4.1.1 
emulator image. After I've unbound from the service, in my test I do this 
in the activity's onPause, when the app process is killed, it and the 
service is restarted. Then after that the process and service is killed and 
restarted every now and then, without starting the activity or any calls to 
startService or bindService made by any code in my test app. It starts 
quicker if I start a couple of different games to put some memory pressure 
on the system.

Not even stopping the cached process in the Cached processes list stops it, 
it is restarted a little while after. Only going to the Downloaded list and 
pressing the Force stop button stops the stop/restart cycle. 

Perhaps someone could look at my dummy app code and point out what I'm 
doing wrong. If someone does, I'm sorry for most likely wasting your time. 

public class MainActivity extends Activity {

@SuppressWarnings(unused)
private int[] mDummyData = new int[3 * 1024 * 1024];
 private final String TAG = MainActivity;
 private boolean mBound;
private boolean mCalledBind;
private boolean mStarted;
private final ServiceConnection mConnection = new ServiceConnection() {

@Override
public void onServiceConnected(ComponentName className, IBinder 
service) {
Log.d(TAG, onServiceConnected);
mBound = true;
}

@Override
public void onServiceDisconnected(ComponentName arg0) {
Log.d(TAG, onServiceDisconnected);
}
};

public MainActivity(){
Log.d(TAG, ctor);
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Intent intent = new Intent(this, MainService.class);

Log.d(TAG, onCreate);

if (!mStarted) {
Log.d(TAG, startService);
startService(intent);
mStarted = true;
}

if (!mBound  !mCalledBind) {
Log.d(TAG, bindService);
bindService(intent, mConnection, BIND_AUTO_CREATE);
mCalledBind = true;
}
}

@Override
protected void onPause() {
Log.d(TAG, onPause);

if (mBound) {
Log.d(TAG, unbindService);
unbindService(mConnection);
mBound = false;
mCalledBind = false;
}

super.onPause();
}

@Override
protected void onDestroy() {
Log.d(TAG, onDestroy);

super.onDestroy();
}
}

public class MainService extends Service {

@SuppressWarnings(unused)
private int[] mDummyData = new int[1024*1024];
 private static final String TAG = MainService;
private final IBinder mBinder = new LocalBinder();
 public class LocalBinder extends Binder {
MainService getService() {
return MainService.this;
}
}
 @Override
public IBinder onBind(Intent arg0) {
Log.d(TAG, onBind);
return mBinder;
}

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.d(TAG, onStartCommand);
return START_NOT_STICKY;
}
 @Override
public void onCreate() {
Log.d(TAG, onCreate);
super.onCreate();
}
}

On Friday, August 10, 2012 8:39:46 PM UTC+2, Dianne Hackborn wrote:

 On Fri, Aug 10, 2012 at 12:17 AM, Johan Appelgren 
 johan.a...@gmail.comjavascript:
  wrote:

 Still occupies some amount of memory though, and the service's onCreate 
 might not be cheap. 


 I'm not sure what this means...?  If you are concerned about the service 
 having too much overhead because you have bound to it and it doesn't need 
 to run just while bound, don't use BIND_AUTO_CREATE.
  

 Anyways, I guess this is one of those little undocumented things you just 
 have to learn. Do not rely on START_NOT_STICKY if you both start and bind 
 to a service if you don't want the service to stay around forever as a 
 cached process after you've unbound it. 


 Honestly I think it is pretty fully documented.  But maybe we have a 
 misunderstanding -- once you unbind from the service, the fact that you had 
 previously bound to it has no further impact on how it is handled, and if 
 its process is killed after that it will not be restarted.

 As long as you are bound to it with BIND_AUTO_CREATE, the system will try 
 to keep it created and if the process is killed while you remain bound to 
 it then it will try to restart it.

 As long as the service is in the started state, the system will try to 
 keep it created/started, and if the process is killed then it will be 
 restarted if it is not sticky.

 The decision about whether to restart the service is if either of those 
 conditions result in it wanting to restart it.

 Again starting and binding are orthogonal to each other.  You just

Re: [android-developers] Non sticky service gets recreated (indefinetly?)

2012-08-09 Thread Johan Appelgren
Ok, thanks. But shouldn't it (non-sticky service with no active 
connections, nothing is bound to it) show up in the Running Services view 
when it has been restarted? Or is that only for sticky services?

On Thursday, August 9, 2012 8:35:50 AM UTC+2, Dianne Hackborn wrote:

 Binding and starting are completely orthogonal things.  You bind to a 
 service to establish a persistent connection to it.  You start a service to 
 have it run for some undefined amount of time separately from the caller. 
  A service needs to remain created as long as it is being asked to do 
 either of these things.

 If you don't want it to stay created, either don't bind to it when you 
 don't want it around, or don't use BIND_AUTO_CREATE so you aren't forcing 
 it to remain created while bound to it.

 On Wed, Aug 8, 2012 at 10:46 PM, Johan Appelgren 
 johan.a...@gmail.comjavascript:
  wrote:

 So START_NOT_STICKY has no effect once I've bound to it even if I unbind? 
 I must explicitly use stopService if the service has ever been bound to 
 even if there are no more connection? 


 On Thursday, August 9, 2012 2:54:41 AM UTC+2, Dianne Hackborn wrote:

 If you bind to it with BIND_AUTO_CREATE, you are saying you want the 
 service to be created as long as you are bound to it.

 From the documentation:

 A service can be both started and have connections bound to it. In such 
 a case, the system will keep the service running as long as either it is 
 started or there are one or more connections to it with the 
 Context.BIND_AUTO_CREATE flag.

 http://developer.android.com/**reference/android/app/Service.**htmlhttp://developer.android.com/reference/android/app/Service.html

 On Wed, Aug 8, 2012 at 1:52 PM, Johan Appelgren johan.a...@gmail.comwrote:

 If I have a simple service that returns START_NOT_STICKY in 
 onStartCommand and I both start it explicitly (startService) and bind to 
 it 
 (bindService) in onCreate of my activity the service gets recreated after 
 it has been killed over and over again. I unbind the service in onPause of 
 my activity. 

 Logcat shows that the service is scheduled for restart and is restarted 
 over and over again. The service is not shown as running after it's been 
 recreated in Settings - Apps - Running. 

 08-08 21:57:25.081 D/ExampleActivity(23715): onPause
 08-08 22:11:44.480 W/ActivityManager(  306): Scheduling restart of 
 crashed service com.example.service/.**MainService in 5000 ms
  08-08 22:11:49.519 I/ActivityManager(  306): Start proc 
 com.example.strangeservice for service com.example.service/.**
 MainService
 08-08 22:11:49.597 D/ExampleService(24079): onCreate
 08-08 22:27:38.551 I/ActivityManager(  306): No longer want 
 com.example.service (pid 24079): hidden #16
 08-08 22:27:38.574 W/ActivityManager(  306): Scheduling restart of 
 crashed service com.example.service/.**MainService in 5000ms
 08-08 22:27:43.629 I/ActivityManager(  306): Start proc 
 com.example.strangeservice for service com.example.service/.**MainService: 
 pid=24401 uid=10101 gids={1028}
 08-08 22:27:43.785 D/ExampleService(24401): onCreate
 08-08 22:49:59.871 I/ActivityManager(  306): Process 
 com.example.service (pid 24401) has died.
 08-08 22:49:59.871 W/ActivityManager(  306): Scheduling restart of 
 crashed service com.example.service/.**MainService in 5000ms
 08-08 22:50:04.934 I/ActivityManager(  306): Start proc 
 com.example.strangeservice for service com.example.service/.**MainService: 
 pid=24857 uid=10101 gids={1028}
 08-08 22:50:05.051 D/ExampleService(24857): onCreate

 I thought START_NOT_STICKY meant that once it gets killed by Android it 
 wont be restarted unless I explicitly start it again. Or does binding to a 
 service override that and make the service sticky?

 I've been testing this on a Galaxy Nexus with stock Android 4.1.1.

  -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@**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=enhttp://groups.google.com/group/android-developers?hl=en




 -- 
 Dianne Hackborn
 Android framework engineer
 hac...@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-d...@googlegroups.comjavascript:
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




 -- 
 Dianne Hackborn
 Android

[android-developers] Non sticky service gets recreated (indefinetly?)

2012-08-08 Thread Johan Appelgren
If I have a simple service that returns START_NOT_STICKY in onStartCommand 
and I both start it explicitly (startService) and bind to it (bindService) 
in onCreate of my activity the service gets recreated after it has been 
killed over and over again. I unbind the service in onPause of my activity. 

Logcat shows that the service is scheduled for restart and is restarted 
over and over again. The service is not shown as running after it's been 
recreated in Settings - Apps - Running. 

08-08 21:57:25.081 D/ExampleActivity(23715): onPause
08-08 22:11:44.480 W/ActivityManager(  306): Scheduling restart of crashed 
service com.example.service/.MainService in 5000 ms
08-08 22:11:49.519 I/ActivityManager(  306): Start proc 
com.example.strangeservice for service com.example.service/.MainService
08-08 22:11:49.597 D/ExampleService(24079): onCreate
08-08 22:27:38.551 I/ActivityManager(  306): No longer want 
com.example.service (pid 24079): hidden #16
08-08 22:27:38.574 W/ActivityManager(  306): Scheduling restart of crashed 
service com.example.service/.MainService in 5000ms
08-08 22:27:43.629 I/ActivityManager(  306): Start proc 
com.example.strangeservice for service com.example.service/.MainService: 
pid=24401 uid=10101 gids={1028}
08-08 22:27:43.785 D/ExampleService(24401): onCreate
08-08 22:49:59.871 I/ActivityManager(  306): Process com.example.service 
(pid 24401) has died.
08-08 22:49:59.871 W/ActivityManager(  306): Scheduling restart of crashed 
service com.example.service/.MainService in 5000ms
08-08 22:50:04.934 I/ActivityManager(  306): Start proc 
com.example.strangeservice for service com.example.service/.MainService: 
pid=24857 uid=10101 gids={1028}
08-08 22:50:05.051 D/ExampleService(24857): onCreate

I thought START_NOT_STICKY meant that once it gets killed by Android it 
wont be restarted unless I explicitly start it again. Or does binding to a 
service override that and make the service sticky?

I've been testing this on a Galaxy Nexus with stock Android 4.1.1.

-- 
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] Non sticky service gets recreated (indefinetly?)

2012-08-08 Thread Johan Appelgren
So START_NOT_STICKY has no effect once I've bound to it even if I unbind? I 
must explicitly use stopService if the service has ever been bound to even 
if there are no more connection? 

On Thursday, August 9, 2012 2:54:41 AM UTC+2, Dianne Hackborn wrote:

 If you bind to it with BIND_AUTO_CREATE, you are saying you want the 
 service to be created as long as you are bound to it.

 From the documentation:

 A service can be both started and have connections bound to it. In such a 
 case, the system will keep the service running as long as either it is 
 started or there are one or more connections to it with the 
 Context.BIND_AUTO_CREATE flag.

 http://developer.android.com/reference/android/app/Service.html

 On Wed, Aug 8, 2012 at 1:52 PM, Johan Appelgren 
 johan.a...@gmail.comjavascript:
  wrote:

 If I have a simple service that returns START_NOT_STICKY in 
 onStartCommand and I both start it explicitly (startService) and bind to it 
 (bindService) in onCreate of my activity the service gets recreated after 
 it has been killed over and over again. I unbind the service in onPause of 
 my activity. 

 Logcat shows that the service is scheduled for restart and is restarted 
 over and over again. The service is not shown as running after it's been 
 recreated in Settings - Apps - Running. 

 08-08 21:57:25.081 D/ExampleActivity(23715): onPause
 08-08 22:11:44.480 W/ActivityManager(  306): Scheduling restart of 
 crashed service com.example.service/.MainService in 5000 ms
 08-08 22:11:49.519 I/ActivityManager(  306): Start proc 
 com.example.strangeservice for service com.example.service/.MainService
 08-08 22:11:49.597 D/ExampleService(24079): onCreate
 08-08 22:27:38.551 I/ActivityManager(  306): No longer want 
 com.example.service (pid 24079): hidden #16
 08-08 22:27:38.574 W/ActivityManager(  306): Scheduling restart of 
 crashed service com.example.service/.MainService in 5000ms
 08-08 22:27:43.629 I/ActivityManager(  306): Start proc 
 com.example.strangeservice for service com.example.service/.MainService: 
 pid=24401 uid=10101 gids={1028}
 08-08 22:27:43.785 D/ExampleService(24401): onCreate
 08-08 22:49:59.871 I/ActivityManager(  306): Process com.example.service 
 (pid 24401) has died.
 08-08 22:49:59.871 W/ActivityManager(  306): Scheduling restart of 
 crashed service com.example.service/.MainService in 5000ms
 08-08 22:50:04.934 I/ActivityManager(  306): Start proc 
 com.example.strangeservice for service com.example.service/.MainService: 
 pid=24857 uid=10101 gids={1028}
 08-08 22:50:05.051 D/ExampleService(24857): onCreate

 I thought START_NOT_STICKY meant that once it gets killed by Android it 
 wont be restarted unless I explicitly start it again. Or does binding to a 
 service override that and make the service sticky?

 I've been testing this on a Galaxy Nexus with stock Android 4.1.1.

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




 -- 
 Dianne Hackborn
 Android framework engineer
 hac...@android.com javascript:

 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] Re: HTTP Post works only on port 80 when on mobile network (Galaxy Nexus)

2012-07-23 Thread Johan Appelgren
Works fine using 3g on my Galaxy Nexus (stock, Android 4.1.1). 

Are you testing using the same carrier and APN settings on the Desire and 
Galaxy Nexus? I've had some issues with a bad carrier proxy that garbled 
non-port 80 traffic, fixed by removing the proxy from APN. 

On Sunday, July 15, 2012 12:10:02 PM UTC+2, Zoran Smilevski wrote:

 Hello!

 I have a problem with posting data when using mobile data network on a 
 port different than 80. This happens only on Galaxy Nexus. I have also 
 reported a bug with detailed description (
 http://code.google.com/p/android/issues/detail?id=34769). There is also a 
 demo app so anyone can test this.

 I was also trying to send a post using a socket, like it's described on 
 http://www.exampledepot.com/egs/java.net/PostSocket.html. In this case 
 everything works fine.

 I hope that someone will see this and tell me what the hell am I doing 
 wrong or confirm that bug :)


-- 
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: Broadcast receiver not working in ICS

2012-07-13 Thread Johan Appelgren
To request a permission you have to use the uses-permission element. 

http://developer.android.com/guide/topics/manifest/uses-permission-element.html
 

What you have done is require that the sender of the BOOT_COMPLETED intent 
has been granted the RECEIVE_BOOT_COMPLETED permission. Don't think that is 
what you intended. 

http://developer.android.com/guide/topics/manifest/receiver-element.html#prmsn
 

On Thursday, July 12, 2012 11:02:42 AM UTC+2, Live Happy wrote:

 i have  a service with separate processes in  my application run from 
 Broadcast receive after boot completed i tested the code in android 2.3.3 
 and all is work fine but when i tested on ICS 4.0.3 even the processes 
 exist in the applications runing  but its not write the throw  logs  in the 
 receiver class and n the service class  is there any help with that please 

  service android:name=.Services.MyServices 
 android:process=:my_process 
 android:label=MyServices
 intent-filter
action
android:name = .Services.MyServices
/action
/intent-filter
/service
receiver android:name=com.tele.Services.MyReceiver
   android:enabled=true
  
 android:permission=android.permission.RECEIVE_BOOT_COMPLETED
 intent-filter
 action 
 android:name=android.intent.action.BOOT_COMPLETED/
   category android:name=android.intent.category.DEFAULT 
 /
 /intent-filter
 /receiver


-- 
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: Broadcast receiver not working in ICS

2012-07-13 Thread Johan Appelgren
To request a permission you have to use the uses-permission element. 

http://developer.android.com/guide/topics/manifest/uses-permission-element.html
 

What you have done is require that the sender of the BOOT_COMPLETED intent 
has been granted the RECEIVE_BOOT_COMPLETED permission. Don't think that is 
what you intended. 

http://developer.android.com/guide/topics/manifest/receiver-element.html#prmsn
 

On Thursday, July 12, 2012 11:02:42 AM UTC+2, Live Happy wrote:

 i have  a service with separate processes in  my application run from 
 Broadcast receive after boot completed i tested the code in android 2.3.3 
 and all is work fine but when i tested on ICS 4.0.3 even the processes 
 exist in the applications runing  but its not write the throw  logs  in the 
 receiver class and n the service class  is there any help with that please 

  service android:name=.Services.MyServices 
 android:process=:my_process 
 android:label=MyServices
 intent-filter
action
android:name = .Services.MyServices
/action
/intent-filter
/service
receiver android:name=com.tele.Services.MyReceiver
   android:enabled=true
  
 android:permission=android.permission.RECEIVE_BOOT_COMPLETED
 intent-filter
 action 
 android:name=android.intent.action.BOOT_COMPLETED/
   category android:name=android.intent.category.DEFAULT 
 /
 /intent-filter
 /receiver


-- 
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] floating window with actionbar

2012-06-29 Thread Johan Bilien
Hi,

I'm trying to place an activity in a floating window, with an action bar. 
Something similar to this:

http://dl.dropbox.com/u/168185/floating-action-bar.jpg

If I set the theme of my activity to Holo.Light.Dialog, getActionBar() 
returns null.

If I create my own theme, inherit from Holo.Light, and the only change I 
make is to set windowIsFloating to true, the app crashes when accessing the 
action bar, with:

java.lang.IllegalStateException: ActionBarImpl can only be used with a 
compatible window decor layout
E/AndroidRuntime( 9266): at 
com.android.internal.app.ActionBarImpl.init(ActionBarImpl.java:159)
E/AndroidRuntime( 9266): at 
com.android.internal.app.ActionBarImpl.init(ActionBarImpl.java:137)
E/AndroidRuntime( 9266): at 
android.app.Activity.initActionBar(Activity.java:1822)
E/AndroidRuntime( 9266): at 
android.app.Activity.getActionBar(Activity.java:1803)
E/AndroidRuntime( 9266): at 
com.litl.TestFloating.FloatingActivity.onCreate(FloatingActivity.java:12)
E/AndroidRuntime( 9266): at 
android.app.Activity.performCreate(Activity.java:4465)
E/AndroidRuntime( 9266): at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
E/AndroidRuntime( 9266): at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)


I've created a test case 
at https://github.com/jobi/android-test-code/tree/master/TestFloating

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: When the android id can change

2012-06-28 Thread Johan Appelgren
If you mean ANDROID_ID then the documentation is pretty clear I think. 

A 64-bit number (as a hex string) that is randomly generated on the 
device's first boot and should remain constant for the lifetime of the 
device. (The value may change if a factory reset is performed on the 
device.)

http://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID
 

On Thursday, June 28, 2012 10:41:58 AM UTC+2, elio wrote:

 Hi all,
 I'm trying to figure out all cases when an android id can change.
 AFAIK the android id can change if:

- the device is rooted, manually
- changing OS (Cyanogenmod)

 Could it change  upgrading the device in an official way?

 Thanks in advance

 Elio





-- 
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: ICS don't give you a real multitasking.

2012-05-16 Thread Johan Appelgren
You probably have other apps installed with running services and manifest 
registered broadcast receivers receiving broadcasts pushing the fart apps 
out. As long as there is some memory free for non-service apps their 
processes are cached and reused just fine.

http://developer.android.com/guide/topics/fundamentals/processes-and-threads.html#Lifecycle
 

If your app needs to do things in the background you need to do that work 
in a service, if it is really important work in a foreground service even. 

On Wednesday, May 16, 2012 2:39:07 PM UTC+2, sblantipodi wrote:

 As title. 
 After using more than one ICS device I'm convinced that the 
 multitasking offered by ICS is not a real multitasking. 

 I well know this graph: 
 http://developer.android.com/images/activity_lifecycle.png 

 This is good, but how this graph is implemented is horrible. 
 On a galaxy nexus with 1GB of RAM, you can't open four different fart 
 apps that the first one opened is restarted. 

 I can multitask many more apps on my older symbian with 128MB of RAM 
 than on my galaxy nexus with 1GB of RAM. 

 The system that manage memory in ICS is broken, I hope that google 
 will fix this problem soon.

-- 
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: ICS don't give you a real multitasking.

2012-05-16 Thread Johan Appelgren
Could you give a more specific example? Because if I switch between for 
example Twitter, Google+, Zite and the Chrome beta nothing is restarted at 
all. And even if they do it isn't an issue since they continue where they 
left off anyways. 

On Wednesday, May 16, 2012 3:43:34 PM UTC+2, sblantipodi wrote:

 don't try to justify a broken system, please. 

 Take a fresh new galaxy nexus, install on it three small apps, choose 
 you the apps and start them, 
 now open two tabs on your browser, choose you the site, now come back 
 at the first apps opened, you will 
 see that the activity has been restarted, now open the other two apps, 
 now return to browser, the page needs a refresh on every tabs. 

 This is obviously a broken multitasking system. 

 On May 16, 3:34 pm, Johan Appelgren johan.appelg...@gmail.com wrote: 
  You probably have other apps installed with running services and 
 manifest 
  registered broadcast receivers receiving broadcasts pushing the fart 
 apps 
  out. As long as there is some memory free for non-service apps their 
  processes are cached and reused just fine. 
  
  http://developer.android.com/guide/topics/fundamentals/processes-and-... 

  
  If your app needs to do things in the background you need to do that 
 work 
  in a service, if it is really important work in a foreground service 
 even. 
  
  
  
  
  
  
  
  On Wednesday, May 16, 2012 2:39:07 PM UTC+2, sblantipodi wrote: 
  
   As title. 
   After using more than one ICS device I'm convinced that the 
   multitasking offered by ICS is not a real multitasking. 
  
   I well know this graph: 
  http://developer.android.com/images/activity_lifecycle.png 
  
   This is good, but how this graph is implemented is horrible. 
   On a galaxy nexus with 1GB of RAM, you can't open four different fart 
   apps that the first one opened is restarted. 
  
   I can multitask many more apps on my older symbian with 128MB of RAM 
   than on my galaxy nexus with 1GB of RAM. 
  
   The system that manage memory in ICS is broken, I hope that google 
   will fix this problem soon.

-- 
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] Long running Android service is getting recreated over and over

2012-05-10 Thread Johan Appelgren

On Thursday, May 10, 2012 1:30:02 AM UTC+2, Dianne Hackborn wrote:

 Yes well there is this meme spread by certain perhaps not unbiased 
 entities that having multitasking at all, I mean doing multitasking like 
 Android, is bad because it is intrinsically battery consuming.  This is of 
 course not true -- if you create a process and it sits there doing nothing, 
 it ain't going to drain your battery.

 The difference between Android and some other platforms is that it does 
 give background code a lot more freedom to do what they want and run when 
 they want, so they have more freedom to do stuff that will drain your 
 battery.  Android does have some safe-guards for this -- it looks for some 
 fairly clear signals like background processes using wake locks or CPU 
 excessively and kills them if this happens, and a UI to help the user 
 understand how applications are using their battery.  It doesn't have such 
 rigid control where there are only X specific types of things that can be 
 done in the background.  It's a different set of trade-offs, but background 
 processes being intrinsically more battery draining is not one of those 
 trade-offs.


Perhaps the Processes and Threads section in the Dev Guide could make it 
more clear that it is up to each app to stop its background threads and 
otherwise ensure they don't do anything when they're not in the foreground 
then? Seems like a fairly common mistake that is difficult for most users 
to understand, they just notice that their phone gets slower over time. 

Which is why, I guess, some games recommend that you force stop all cached 
processes before playing. Not very user friendly.  

-- 
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: Directly accessing the e-mail app.

2012-04-12 Thread Johan Appelgren
What do you mean with default e-mail app? If the user has selected a 
default e-mail app the user wont get the chooser. If the user hasn't 
selected a default e-mail app the user will get the chooser. 

On Thursday, April 12, 2012 9:12:12 AM UTC+2, Put_tiMe wrote:

 How do I directly choose the default e-mail app, without going through the 
 chooser?

 I would also like to set some of the values through the intent, like:

 emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, recipients);
 emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, blah);
 emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Wow! direct email 
 works);
 emailIntent.setType(text/plain);


 Is there any way I can do it, without going through the chooser?




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

Re: [android-developers] Re: [Android - developers] Exponential Smoothing on Latitude and Langitude

2012-04-01 Thread agung wiguna johan
Hi David, thanks for your respond
I already solved the problem here
The problem's my mistake in a code at the smoothing formula, i use the
wrong value
Anyway, anybody here know about high pass filter?
Thanks

On Mon, Mar 26, 2012 at 5:51 PM, David Griffiths davi...@cordic.com wrote:

 Sorry, my mistake.

 The line

 smoothingCoor[i] = smoothingCoor [i] +alpha * (coor[i] -
 smoothingCoor[i]);

 is correct as it stands. However my comment on your nearing smoothing not
 taking into account the 359 degrees problem is correct.

 Two other problems with the code you have posted: I presume that coor is
 declared as int[] coor = new int[2]; and smoothingCoor as int[]
 smoothingCoor = null;

 So your line smoothingCorr = coor; causes both variables to refer to the
 same array so coor[0] and smoothingCoor[0] always have the same value. The
 other problem is that smoothLat should be smoothingCoor / 1.0E6. Of
 course smoothLat needs to be a double. In fact I can't see why you convert
 the lat/long values into ints - the smoothing agorithm is going to work
 better on floating point numbers.

 --
 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: How I disable GPS when i exit Application

2012-03-28 Thread Johan Appelgren
Afaik you should never use android.os.Process.killProcess or 
ActivityManager.killBackgroundProcesses.

On Wednesday, March 28, 2012 7:50:40 AM UTC+2, Ankit Kasliwal wrote:

 Hello,
  I have problem in my application when i press exit i try to close 
 all my activity but GPS running so how i disable GPS status and close my 
 application (because when i go to Application manager it's show mw my 
 application running and force close button enable)

 my code to close all activity are..


 android.os.Process.killProcess(android.os.Process.myPid());
 System.exit(0);

 killThisPackageIfRunning(HomePage.this,getApplication().getPackageName());
 finish();

 public static void killThisPackageIfRunning(final Context context, String 
 packageName){
 ActivityManager activityManager = 
 (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
 activityManager.killBackgroundProcesses(packageName);
 } 



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

Re: [android-developers] Re: How I disable GPS when i exit Application

2012-03-28 Thread Johan Appelgren
It is still the wrong thing to do. Just because the API allows you to do 
something wrong doesn't mean you have to do it. 

On Wednesday, March 28, 2012 10:41:04 AM UTC+2, Ankit Kasliwal wrote:

 Johan i use that command the it's working properly.

 On Wed, Mar 28, 2012 at 12:39 PM, Johan Appelgren wrote:

 Afaik you should never use android.os.Process.**killProcess or 
 ActivityManager.killBackgroundProcesses.


 On Wednesday, March 28, 2012 7:50:40 AM UTC+2, Ankit Kasliwal wrote:

 Hello,
  I have problem in my application when i press exit i try to 
 close all my activity but GPS running so how i disable GPS status and close 
 my application (because when i go to Application manager it's show mw my 
 application running and force close button enable)

 my code to close all activity are..


 android.os.Process.**killProcess(android.os.**Process.myPid());
 System.exit(0);

 killThisPackageIfRunning(**HomePage.this,getApplication()**
 .getPackageName());
 finish();

 public static void killThisPackageIfRunning(final Context context, 
 String packageName){
 ActivityManager activityManager = (ActivityManager)context.**
 getSystemService(Context.**ACTIVITY_SERVICE);
 activityManager.**killBackgroundProcesses(**packageName);
 } 

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




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

Re: [android-developers] Re: How I disable GPS when i exit Application

2012-03-28 Thread Johan Appelgren
If you want to programatically leave (finish) the current activity you can 
use Activity.finish but in most cases you don't have to do anything, the 
user will either leave the current activity using their back or home 
button. Then all you need to do is properly handle the activity lifecycle 
events. In any case Android will take care of managing the process for you. 

http://developer.android.com/guide/topics/fundamentals/activities.html#ShuttingDown
 
http://developer.android.com/guide/topics/fundamentals/activities.html#Lifecycle
 

On Wednesday, March 28, 2012 10:58:08 AM UTC+2, Ankit Kasliwal wrote:

 so can you tell me the process 

 On Wed, Mar 28, 2012 at 2:25 PM, Johan Appelgren wrote:

 It is still the wrong thing to do. Just because the API allows you to do 
 something wrong doesn't mean you have to do it. 


 On Wednesday, March 28, 2012 10:41:04 AM UTC+2, Ankit Kasliwal wrote:

 Johan i use that command the it's working properly.

 On Wed, Mar 28, 2012 at 12:39 PM, Johan Appelgren wrote:

 Afaik you should never use android.os.Process.**killPro**cess or 
 ActivityManager.**killBackgroundProcesses.


 On Wednesday, March 28, 2012 7:50:40 AM UTC+2, Ankit Kasliwal wrote:

 Hello,
  I have problem in my application when i press exit i try to 
 close all my activity but GPS running so how i disable GPS status and 
 close 
 my application (because when i go to Application manager it's show mw my 
 application running and force close button enable)

 my code to close all activity are..


 android.os.Process.**killProcess**(android.os.**Process.myPid());
 System.exit(0);

 killThisPackageIfRunning(**HomeP**age.this,getApplication()**.**
 getPackageName());
 finish();

 public static void killThisPackageIfRunning(final Context context, 
 String packageName){
 ActivityManager activityManager = (ActivityManager)context.**
 getSy**stemService(Context.**ACTIVITY_**SERVICE);
 activityManager.**killBackground**Processes(**packageName);
 } 




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

Re: [android-developers] Re: [Android - developers] Exponential Smoothing on Latitude and Langitude

2012-03-25 Thread agung wiguna johan
Hi jinja, thanks for the help
I already tried with the fixed point but it still get me the wrong value
Are there something filtering that we can use to filter latitude and
longitude ? (except kalman filter)
Sory for my bad english

On Fri, Mar 16, 2012 at 12:17 AM, Jinja neiljmar...@gmail.com wrote:

 Hi Concave,

 Okay, I see that you need to keep the values as x1E6 now. However, you are
 still multiplying by 1E6 twice, you only need to do it once. Remove the
 *1E6 from the following lines, so..

 smoothLat = (int) (smoothingCoor [0] * 1E6);
 smoothLongi = (int) (smoothingCoor [1] * 1E6);

 becomes...

 smoothLat = (int) (smoothingCoor [0]);
 smoothLongi = (int) (smoothingCoor [1]);

 Try stepping through your code in the debugger to reveal if your values
 now remain in the correct order of magnitude. Until you've fixed the bug in
 your filtering code I recommend you lock the GPS to a known value e.g.
 insert this at the top of your function...

 newLocation.setLatitude( 49.28214015975995 );
 newLocation.setLongitude( -123.12438011169434 );

 That's Vancouver, use some location you will recognize as correct. Once
 your filter works then you can remove the fixed location and start using
 the GPS values again.




 On Thursday, March 15, 2012 6:58:04 AM UTC-7, concave wrote:

 Hi, thanks for all the input
 Right now i still don't have any solution for get the best latitude and
 longitude
 I want to use kalman filter at the first, but after read some paper and
 articles kalman filter is need the value from accelorometer
 Unfortunately my requirement for this application is doesn't use any
 sensor except the gps

 @jinja : Hi thanks for the input, but i think it's the right way to get
 the gps value.
  Because i need the int type value to put it on GeoPoint methode and get
 the GeoPoint to animateTo ().


 On Tue, Mar 13, 2012 at 1:47 PM, Yaron Reinharts 
 yaron.reinha...@gmail.com wrote:

  Hi,

 There is a section with the title Maintaining a current best estimate
 in the following link, it contains an implementation of a method called 
 isBetterLocation.
 http://developer.android.com/**guide/topics/location/**
 obtaining-user-location.htmlhttp://developer.android.com/guide/topics/location/obtaining-user-location.html

 Hope this helps
 /Yaron

 --
 Yaron Reinharts
 Smart Drive Applicationshttp://www.poncho.co.il/**gateaway.php 
 http://www.poncho.co.il/gateaway.phphttps://market.android.com/**details?id=com.poncho.gsm.**gate.activities
  https://market.android.com/details?id=com.poncho.gsm.gate.activities



 On 03/13/2012 05:32 AM, Jinja wrote:

 Hello, I've never dealt with GPS data before, but having a quick look at
 your code it looks like you have a mismatch in converting your data to and
 from integers and doubles.

 I notice you multiply by 1E6 when extracting the lat/long, presumably
 this is to maintain some accuracy during the double to int conversion...

  int lat = (int) (currentPosition.getLatitude()*1E6);

  So one fix is to use all doubles and remove all of your *1E6. The
 other fix is to use /1E6 instead of *1E6 when converting back to doubles...

  currentPosition.**setLatitude(**smoothingCoor [0] / 1E6);

  instead of...

  smoothLat = (int) (smoothingCoor [0] * 1E6);
 currentPosition.**setLatitude(**smoothLat);

  I hope that fixes your issue.



 On Sunday, March 11, 2012 12:46:24 AM UTC-8, concave wrote:

 Hi guys, i've a little problem here.
 I'm working with gps data, getting values every second and displaying
 current position on a map.
 The problem is that sometimes (specially when im using the app on
 indoor and not make a move) the values vary a lot, making the current
 position to change.
 I was wondering about some easy enough method to avoid this.
  As a first idea, I thought about discarding values with accuracy
 beyond certain threshold, and use Exponential filtering as i use on my
 Bearing. But i get up on Antartica. Here's the code that i used to get
 the location and filtering it with exponential :

 public void onLocationChanged(Location newLocation) {
// Get previous Location, needed to get
 the Bearing Value
     if(currentPosition != null)
     {
     prevLocation =
 currentPosition;
     pLat = (int)
 (prevLocation.getLatitude() *1E6);
     pLongi = (int)
 (prevLocation.getLongitude()***1**E6);

     }
     currentPosition = new Location
 (newLocation);
     int lat = (int)
 (currentPosition.getLatitude()*1E6);
     int longi = (int)
 (currentPosition.getLongitude()*1E6);

     //Smoothing Latitude,Longitude
     

Re: [android-developers] Re: [Android - developers] Exponential Smoothing on Latitude and Langitude

2012-03-15 Thread agung wiguna johan
Hi, thanks for all the input
Right now i still don't have any solution for get the best latitude and
longitude
I want to use kalman filter at the first, but after read some paper and
articles kalman filter is need the value from accelorometer
Unfortunately my requirement for this application is doesn't use any sensor
except the gps

@jinja : Hi thanks for the input, but i think it's the right way to get the
gps value.
 Because i need the int type value to put it on GeoPoint methode and get
the GeoPoint to animateTo ().


On Tue, Mar 13, 2012 at 1:47 PM, Yaron Reinharts
yaron.reinha...@gmail.comwrote:

  Hi,

 There is a section with the title Maintaining a current best estimate in
 the following link, it contains an implementation of a method called 
 isBetterLocation.

 http://developer.android.com/guide/topics/location/obtaining-user-location.html

 Hope this helps
 /Yaron

 --
 Yaron Reinharts
 Smart Drive 
 Applicationshttp://www.poncho.co.il/gateaway.phphttps://market.android.com/details?id=com.poncho.gsm.gate.activities



 On 03/13/2012 05:32 AM, Jinja wrote:

 Hello, I've never dealt with GPS data before, but having a quick look at
 your code it looks like you have a mismatch in converting your data to and
 from integers and doubles.

 I notice you multiply by 1E6 when extracting the lat/long, presumably this
 is to maintain some accuracy during the double to int conversion...

  int lat = (int) (currentPosition.getLatitude()***1E6);

  So one fix is to use all doubles and remove all of your *1E6. The other
 fix is to use /1E6 instead of *1E6 when converting back to doubles...

  currentPosition.**setLatitude(smoothingCoor [0] / 1E6);

  instead of...

  smoothLat = (int) (smoothingCoor [0] * 1E6);
 currentPosition.**setLatitude(smoothLat);

  I hope that fixes your issue.



 On Sunday, March 11, 2012 12:46:24 AM UTC-8, concave wrote:

 Hi guys, i've a little problem here.
 I'm working with gps data, getting values every second and displaying
 current position on a map.
 The problem is that sometimes (specially when im using the app on
 indoor and not make a move) the values vary a lot, making the current
 position to change.
 I was wondering about some easy enough method to avoid this.
  As a first idea, I thought about discarding values with accuracy
 beyond certain threshold, and use Exponential filtering as i use on my
 Bearing. But i get up on Antartica. Here's the code that i used to get
 the location and filtering it with exponential :

 public void onLocationChanged(Location newLocation) {
// Get previous Location, needed to get
 the Bearing Value
   **  if(currentPosition != null)
   **  {
   **  prevLocation =
 currentPosition;
   **  pLat = (int)
 (prevLocation.getLatitude() *1E6);
   **  pLongi = (int)
 (prevLocation.getLongitude()***1E6);

   **  }
   **  currentPosition = new Location
 (newLocation);
   **  int lat = (int)
 (currentPosition.getLatitude()***1E6);
   **  int longi = (int)
 (currentPosition.getLongitude(**)*1E6);

   **  //Smoothing Latitude,Longitude
   **  if(lat != 0  longi != 0){
   **  coor[0] = lat;
   **  coor[1] = longi;
   **  if (smoothingCoor == null){
   **  **smoothingCoor =
 coor;
   **  }
   **  for (i=0;
 icoor.length;i++){
   **  **smoothingCoor[i]
 = smoothingCoor [i] +alpha * (coor[i] -
 smoothingCoor[i]);
   **  }
   **  smoothLat = (int)
 (smoothingCoor [0] * 1E6);
   **  smoothLongi = (int)
 (smoothingCoor [1] * 1E6);

   **  
 currentPosition.**setLatitude(smoothLat);

   **  
 currentPosition.**setLongitude(smoothLongi);

   **  }

   **  // Get Bearing Value
   **  if(prevLocation != null 
 currentPosition != null){

   **  bearing = 
 prevLocation.bearingTo(**currentPosition);


   **  //Smoothing bearing value with
 exponential
   **  if (smoothingBearing == 0) {
 **smoothingBearing = bearing;
   **  } else {

[android-developers] [Android - developers] Convert Decimal latitude longitude to Dms form

2012-03-15 Thread agung wiguna johan
Hi, can somebody tell me (and give sample code if possible) how to convert
the decimal latitude longitude into DMS form?
I already seach for this method, but i still have the problem to convert it.
Thanks

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

Re: [android-developers] [Android - developers] Exponential Smoothing on Latitude and Langitude

2012-03-12 Thread agung wiguna johan
Can somebody help me ?
I don't have idea what filtering that i can use to clean noise from
latitude and longitude


On Sun, Mar 11, 2012 at 3:46 PM, concave agung.wiguna.jo...@gmail.comwrote:

 Hi guys, i've a little problem here.
 I'm working with gps data, getting values every second and displaying
 current position on a map.
 The problem is that sometimes (specially when im using the app on
 indoor and not make a move) the values vary a lot, making the current
 position to change.
 I was wondering about some easy enough method to avoid this.
  As a first idea, I thought about discarding values with accuracy
 beyond certain threshold, and use Exponential filtering as i use on my
 Bearing. But i get up on Antartica. Here's the code that i used to get
 the location and filtering it with exponential :

 public void onLocationChanged(Location newLocation) {
   // Get previous Location, needed to get
 the Bearing Value
if(currentPosition != null)
{
prevLocation =
 currentPosition;
pLat = (int)
 (prevLocation.getLatitude() *1E6);
pLongi = (int)
 (prevLocation.getLongitude()*1E6);

}
currentPosition = new Location
 (newLocation);
int lat = (int)
 (currentPosition.getLatitude()*1E6);
int longi = (int)
 (currentPosition.getLongitude()*1E6);

//Smoothing Latitude,Longitude
if(lat != 0  longi != 0){
coor[0] = lat;
coor[1] = longi;
if (smoothingCoor == null){
smoothingCoor = coor;
}
for (i=0;
 icoor.length;i++){
smoothingCoor[i] =
 smoothingCoor [i] +alpha * (coor[i] -
 smoothingCoor[i]);
}
smoothLat = (int)
 (smoothingCoor [0] * 1E6);
smoothLongi = (int)
 (smoothingCoor [1] * 1E6);


  currentPosition.setLatitude(smoothLat);

  currentPosition.setLongitude(smoothLongi);
}

// Get Bearing Value
if(prevLocation != null  currentPosition
 != null){

bearing =
 prevLocation.bearingTo(currentPosition);

//Smoothing bearing value with exponential
if (smoothingBearing == 0) {
smoothingBearing = bearing;
} else {
smoothingBearing = smoothingBearing +alpha
 * (bearing -
 smoothingBearing);
}

}

 Hope you can understand my explanataion, and i provide enough
 information
 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

Re: [android-developers] Re: [Android - developers] Saving Latitude and Longitude value

2012-03-10 Thread agung wiguna johan
Hi sory for the late replay, and sory for the lacked information on my
question. I don't know how to provide the error code, because when i debug
the application, i don't get any error code.
But i already solved the problem now.
Thanks for your help,and correction

On Fri, Mar 9, 2012 at 4:18 AM, TreKing treking...@gmail.com wrote:

 On Wed, Mar 7, 2012 at 9:06 PM, agung wiguna johan 
 agung.wiguna.jo...@gmail.com wrote:

 But when i running the program, it's take long to get the coordinates,


 That's GPS for you.


 and get force close at the end.


 Debug your app. How do you expect anyone here to help you with
 non-existent information about your crash?


 -
 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 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 - developers] Saving Latitude and Longitude value

2012-03-08 Thread agung wiguna johan
Update :
I found the solution,but still getting error. Use 2 location variable to
get the previous position before changed :

public void onLocationChanged(Location newLocation) {
prevLocation = currentPosition;
currentPosition = new Location (newLocation);
int lat1 = (int) (currentPosition.getLatitude()*1E6);
int longi1 = (int) (currentPosition.getLongitude()*1E6);
geoPoint = new GeoPoint (lat1, longi1);
showPosition();
mapView.getController().animateTo(geoPoint);
mapView.invalidate();
//Toast.makeText(getBaseContext(), position = + currentPosition,
Toast.LENGTH_LONG).show();
//mapView.postInvalidate();
 //showPosition();
bearing = prevLocation.bearingTo(currentPosition);
   }
};
  }

But when i running the program, it's take long to get the coordinates, and
get force close at the end.
Can somebody help me?

On Wed, Mar 7, 2012 at 11:43 AM, concave agung.wiguna.jo...@gmail.comwrote:

 Hi all, need help in here
 I developed Map android, and one of the feature is the map can rotate.
 I already tried to rotate map with sensor, and it's success. But now ,
 i need to developed map that can rotate without any sensor.
 So, i need to get an angle from 2 coordinates (first before the
 location changed/ or user change direction, second after location
 changed / user change direction)
 But i don't have any idea how to get coordinates before the location
 changed (before the value latitude and longitude updated).
 Can somebody help me to solved this ?
 Thanks

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

[android-developers] [Android-developers]

2012-03-08 Thread agung wiguna johan
Hi all
I have an problem here.
I was developing an map application, and it have feature to rotate the map
when user changed direction.
I know the easiest way to rotate it is, with the Orientation sensor.
But for know, i need to rotate it without sensor.
IMHO it's possible to rotating map with the angle from 2 coordinates
(Before location changed, and after location changed/updated)
But i don't have any idea to save the latitude and longitude before the
location changed.
Can anybody help me please ?i already tried it with minimum success for 3
weeks
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: On ICS, Stopped service can't receive an intent.

2012-01-30 Thread Johan Appelgren
You're probably running into this behavior introduced in Android 3.1

http://developer.android.com/sdk/android-3.1.html#launchcontrols 

-- 
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: Avoid android taking screenshot/snapshot of activity while going in background

2012-01-20 Thread Johan Appelgren
A quick search in this group gave me 
this: 
https://groups.google.com/d/msg/android-developers/363Au8CqdLY/UhsUnEgZViIJ

http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE
 

-- 
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: Avoid android taking screenshot/snapshot of activity while going in background

2012-01-20 Thread Johan Appelgren
Did you try using the FLAG_SECURE flag? 

-- 
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: Is possible use AlarmManager to schedule run a Service

2012-01-19 Thread Johan Appelgren
Because all pending alarms for an app are removed when it is killed (force 
closed). So don't kill your app. 

-- 
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] Sony Ericsson Smart Extension SDK for SmartWatch and Smart Wireless Headset pro

2012-01-10 Thread Johan Abramsson
Hi Developers out there,
Last night we at Developer World released the Smart Extension SDK
which you can use to develop Android applications for accessories
supporting the Smart Extras API. As of today that is SmartWatch and
Smart Wireless Headset pro.

To download and get more information please see:
http://developer.sonyericsson.com/wp/2012/01/10/new-smart-extras-announced-and-a-new-sdk-to-create-apps-for-them/

Feel free to drop comments and questions about the Smart Extensions
SDK in this thread. We will monitor and try to answer questions as
soon as possible.

Kind regards
  /Johan, Developer World

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


Re: [android-developers] Is it possible to have a static view common to various activities in the application?

2011-11-28 Thread Johan Rydenstam
It's possible.

Create a Layout you would like to have in A,B and C.

Then use include in each of the layouts.

Example:

include android:id=@+id/header
layout=@layout/header
android:layout_height=wrap_content
android:layout_width=fill_parent/



On Nov 28, 2011, at 2:26 PM, B.Arunkumar wrote:

 Hi,
 
I just had a question if it is possible to have a static view
 across different layouts in activities defined? What I mean is that I
 have a number of activities in a project:
 
 1.Activity A
 2.Activity B
 3.Activity C
 
 I need a view which appears in each of these activities but I don't
 want to define the view separately in all the 3 layout xml. How do I
 do it?
 
 Thank you,
 B.Arunkumar
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

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

Re: [android-developers] Need Help in Options Menu

2011-11-25 Thread Johan Rydenstam
Several ways to do this. One solution is to have two XML files that defines the 
different menus.


On Nov 25, 2011, at 9:19 AM, Kiran Kumar Kendole wrote:

 Hi Guys,
 
 I am trying to design a options menu. I tried it, working fine. But the 
 problem , It is showing same options for all pages. 
 My requriement is 
 
 In Home Page ( I need only EDIT, DELETE,ATTACH options)
 Second Page ( I need only BACK , HOME , EXIT  options).
 
 Like I want some of the options for some pages. Please suggest me.
 
 Thanks,
 KIRANKUMARKENDOLE
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

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

Re: [android-developers] Need Help in Options Menu

2011-11-25 Thread Johan Rydenstam
How do you know what menu you want?

You could start the activity by passing in some extra parameter with the intent.

  public boolean onCreateOptionsMenu(Menu menu) {
 MenuInflater inflater = getMenuInflater();
if(getIntent.getBooleanExtra(second_menu,true))
 inflater.inflate(R.menu.optionsmenu, menu);
else
inflater.inflate(R.meny.optonsSecondMenu, menu);
 return true;
 }


On Nov 25, 2011, at 10:03 AM, Kiran Kumar Kendole wrote:

 Thanks for the reply.
 I have two XMLs. And One Activity Class. there I used one XML like this.
  public boolean onCreateOptionsMenu(Menu menu) {
 MenuInflater inflater = getMenuInflater();
 inflater.inflate(R.menu.optionsmenu, menu);
 return true;
 }
 
 But it is showing the same options for all screens. Could you please let me 
 know how to use the second XML.
 
 Thanks,
 KIRANKUMARKENDOLE
 
 
 On Fri, Nov 25, 2011 at 3:23 AM, Johan Rydenstam 
 johanrydens...@googlemail.com wrote:
 Several ways to do this. One solution is to have two XML files that defines 
 the different menus.
 
 
 On Nov 25, 2011, at 9:19 AM, Kiran Kumar Kendole wrote:
 
 Hi Guys,
 
 I am trying to design a options menu. I tried it, working fine. But the 
 problem , It is showing same options for all pages. 
 My requriement is 
 
 In Home Page ( I need only EDIT, DELETE,ATTACH options)
 Second Page ( I need only BACK , HOME , EXIT  options).
 
 Like I want some of the options for some pages. Please suggest me.
 
 Thanks,
 KIRANKUMARKENDOLE
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
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] Need Help in Options Menu

2011-11-25 Thread Johan Rydenstam
You can add and remove buttons programatically. Don't how by heart. Google it :)
On Nov 25, 2011, at 10:43 AM, Kiran Kumar Kendole wrote:

 Thanks. It worked after using Intent.
 
 Any other way.. with using one XML file.
 
 Thanks,
 KIRANKUMARKENDOLE
 
 
 On Fri, Nov 25, 2011 at 4:07 AM, Johan Rydenstam 
 johanrydens...@googlemail.com wrote:
 How do you know what menu you want?
 
 You could start the activity by passing in some extra parameter with the 
 intent.
 
  public boolean onCreateOptionsMenu(Menu menu) {
 MenuInflater inflater = getMenuInflater();
   
 if(getIntent.getBooleanExtra(second_menu,true))
 inflater.inflate(R.menu.optionsmenu, menu);
   else
   inflater.inflate(R.meny.optonsSecondMenu, menu);
 return true;
 }
 
 
 On Nov 25, 2011, at 10:03 AM, Kiran Kumar Kendole wrote:
 
 Thanks for the reply.
 I have two XMLs. And One Activity Class. there I used one XML like this.
  public boolean onCreateOptionsMenu(Menu menu) {
 MenuInflater inflater = getMenuInflater();
 inflater.inflate(R.menu.optionsmenu, menu);
 return true;
 }
 
 But it is showing the same options for all screens. Could you please let me 
 know how to use the second XML.
 
 Thanks,
 KIRANKUMARKENDOLE
 
 
 On Fri, Nov 25, 2011 at 3:23 AM, Johan Rydenstam 
 johanrydens...@googlemail.com wrote:
 Several ways to do this. One solution is to have two XML files that defines 
 the different menus.
 
 
 On Nov 25, 2011, at 9:19 AM, Kiran Kumar Kendole wrote:
 
 Hi Guys,
 
 I am trying to design a options menu. I tried it, working fine. But the 
 problem , It is showing same options for all pages. 
 My requriement is 
 
 In Home Page ( I need only EDIT, DELETE,ATTACH options)
 Second Page ( I need only BACK , HOME , EXIT  options).
 
 Like I want some of the options for some pages. Please suggest me.
 
 Thanks,
 KIRANKUMARKENDOLE
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

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

Re: [android-developers] OutOfMemoryError

2011-11-24 Thread Johan Rydenstam
Are you using different resources for the tablet (like hdpi?).

I would check for memory leaks. There are tools you can use for this ( Eclipse 
memory analyzer)
 
On Nov 24, 2011, at 9:51 AM, bob wrote:

 OutOfMemoryError
 
 I'm getting this OutOfMemoryError:
 
 11-24 00:38:10.925: ERROR/dalvikvm-heap(1782): 144-byte external
 allocation too large for this process.
 11-24 00:38:10.965: ERROR/GraphicsJNI(1782): VM won't let us allocate
 144 bytes
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): FATAL EXCEPTION: main
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782):
 java.lang.OutOfMemoryError: bitmap size exceeds VM budget
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:520)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.MyApp.getBitmap(MyApp.java:1047)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.MyApp.loadImages(MyApp.java:1217)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.Panel.onDraw(Panel.java:906)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6880)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1646)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1644)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6883)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.widget.FrameLayout.draw(FrameLayout.java:363)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1646)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6883)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.widget.FrameLayout.draw(FrameLayout.java:363)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.policy.impl.PhoneWindow
 $DecorView.draw(PhoneWindow.java:1862)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.draw(ViewRoot.java:1522)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.performTraversals(ViewRoot.java:1258)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.os.Handler.dispatchMessage(Handler.java:99)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.os.Looper.loop(Looper.java:123)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.app.ActivityThread.main(ActivityThread.java:3647)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 java.lang.reflect.Method.invokeNative(Native Method)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 java.lang.reflect.Method.invoke(Method.java:507)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:839)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 dalvik.system.NativeStart.main(Native Method)
 
 Is there any easy way around this, or do I just have to use less
 memory?  This game works fine on my phone, but strangely the error
 shows up on my tablet.
 
 -- 
 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] Firewall rules. Subnets/IPs C2dm Alternativ

2011-11-22 Thread Johan Rydenstam
I have written a C2DM solution. However I need to setup firewall
rules
for the solution.
In this case it is impossible to open up for URLs. And the service
needs to access
https://android.apis.google.com/c2dm/send
and
https://www.google.com/accounts/ClientLogin
How can this be done? Are there any specific subnets for 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] Android 3.1 and Bluetooth HID

2011-10-24 Thread Johan Zander

The Android 3.1 Platform Highlights [1] states:
To make the platform even better for gaming, Android 3.1 adds support
for most PC joysticks and gamepads that are connected over USB or
Bluetooth HID.

Has anyone out there successfully got an Android application to
communicate with a Bluetooth HID device? In that case, how? Is it the
USB host API [2] that should be used?
We've tried with a Motorola XOOM 3.1 without any success, but there
are many threads reporting problems with the Xoom and USB host API.

References:
[1] http://developer.android.com/sdk/android-3.1-highlights.html#UserFeatures:
[2] http://developer.android.com/guide/topics/usb/host.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] Re: SE LiveView SDK Template app

2011-09-01 Thread Johan Abramsson
Basically, you can rename your classes and packages as you want to.
What you need to keep intact is the interface package, i.e.
com.sonyericsson.extras.liveview.IPluginServiceCallbackV1/
IPluginService

And you need to keep track of your naming of the intents in the
manifest and res/values/strings.xml.

Manifest: application-service-intent-filter-action-name needs to
correspond to res/values/strings.xml-intent_service
Manifest: application-application-intent-filter-action-name needs
to correspon to res/values/strings.xml-intent_preferences

Renaming the other packages and names also need to be defined
correctly in the manifest. Easiest way to get that right is to check
the current manifest setup of the template-project or the other
examples, and change the manifest accordingly. Some things will
hopefully be corrected for you by the built-in functionality of your
IDE, e.g. Eclipse.

Kind regards
  /Johan, Sony Ericsson Developer Support

On Aug 21, 11:09 pm, PeLa perlarsso...@gmail.com wrote:
 Hi,

 I would like to develop apps that uses Sony Ericsson's LiveView
 device. I'm new to Android and Java, so my question my seem stupid. My
 experience is mainly C/C++ with Microsoft's MFC and Nokia's Qt, but
 Java seems to be not too far from C++. I managed to make some changes
 to the Sandbox example app which is included with the LiveView SDK,
 and it behave like I expected, so it seems like have understood at
 least a bit of LiveView, Android and Java. Now, here's my stupid
 question.

 In Eclipse, I import the template app included with the SDK, and call
 it something else. Now, what changes should I do to it in terms of
 names of files, names of packages, etc?

 Everywhere I saw the name Template, I changed it to my own app name,
 but that leaves a lot of package names beginning with
 com.sonyericsson... and ending with my app name. I guess I should
 change the beginning of some package names, but probably not all.
 Which ones should I change?

 It would have been nice if the template files had more detaild
 instruction comments, like
 // TODO: change the next next line to the format
 myTopDomain.myDomain.MyExtraHierachy.MyAppname

 I used appXplore to check other LiveView plugins from Market, just to
 see how others did. And it's a mix. Some have kept  com.sony.ericsson
 in the beginning of their package names, process names, and preference
 activities, and some have changed to their own. (I know that some of
 the LiveView plugins in Marked are developed by Sony Ericsson, so it's
 natural that they kept com.sonyericsson... but some non-sony-ericsson
 also kept it).

 So, it seems like I'm not the only one who need guidence.It would be
 nice if Sony Ericsson presented guidlines on how they expect people to
 do. If they don't, it would be nice if someone else wrote detailed
 instructions.

 Should the following keep their names (including com.sonyericsson...)
 myProjName/src/com.sonyericsson.extras.liveview
 myProjName/src/com.sonyericsson.extras.liveview.plugins

 Should I change the following:
 myProjName/src/com.sonyericsson.extras.liveview.plugins.template
 to for example
 myProjName/src/
 myTopDomain.myDomain.myAppName.liveview.plugins.myAppName

 I tried that,and updated the manifest etc, but I didn't get it to
 work. Should I have done something else?

 It would have been really nice for beginners like me with specific
 TODO: comments saying exactly what to do.

 Thanks in advance

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


[android-developers] Re: Need ideas on encrypting h.264 videos on Android

2011-09-01 Thread Johan Lindquist
Interesting idea, but a couple if questions come to my mind - what
kind of file descriptor is OUT FD in this case?  Since it would have
to be writable from one end and readable from the other it would have
to be some sort of pipe?

I ask because we are only passing the descriptor to the MediaPlayer
which would then be accessed independently of any InputStream/
RandomAccess file that created it, giving us little chance to override
any of these operations.  Bear with me if I am missing the obvious
here though.

Also, for what it is worth, FD is final, making it hard to override.

Ideally, it would be open up a variety of options if the media player
allowed for data to be provided as part of a set of callbacks,
removing the reliance on support for various transports in the native
layer itself.

Cheers,

Johan


On Aug 12, 7:45 am, Daniel Drozdzewski daniel.drozdzew...@gmail.com
wrote:
 On 12 August 2011 11:28, Sumedh Jiwane sumed...@gmail.com wrote:









  actually not sure what do you want to do. can you be elaborate more. Do you
  want to play local file or remote file. Do you want to stream or download
  and play?

  On Fri, Aug 12, 2011 at 8:28 AM, Peter Taps ptr...@gmail.com wrote:

  Folks,

  Our application requires that a H.264 video be kept on the disk in an
  encrypted format. One should be able to play this video only through our
  application.

  I am seeking ideas on the best way to achieve this.

  I looked at VideoView class. Looks like it can only take a file, HTTP or
  RTSP uri. One thought I had was to implement a RTSP server on the device as
  part of our application but that may be an overkill.

  I would appreciate your thought..

  Thank you in advance for your help.

  Best regards,
  Peter

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

 Peter, looking at various available APIs, it seems that you have 1
 choice (maybe 2):

 1) to decrypt the video into a temporary local file and prepare
 MediaPlayer (or VideoView) with URI to this temp file.
 It obviously makes you vulnerable to attack, between creation and
 deletion of said file.

 possible 2) Extend FileDescriptor class so that it's IN file
 descriptor points at encrypted video file
 FD.sync() of your extended FD causes read +  decrypt + write to OUT FD
 (which is what MediaPlayer reads from) of some chunk of the encrypted
 file. The resulting amount of decrypted bytes should be big enough to
 keep the player occupied. Please also mind that this will all depend
 on the 'power' of host hardware.

 Your sync() method should be overriding parts of file that OUT FD
 points to, that have been consumed already by the Player with some
 random gibberish. You will need to use RandomAccessFile to create the
 OUT FD and keep track of its offset for erasing and for playing.

 Good Luck!

 --
 Daniel Drozdzewski

-- 
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] Xperia™ active pressure sensor

2011-08-24 Thread Johan Abramsson
Hi,
this is a news post to make note of this blog post by SonyEricsson
Developer team:
http://blogs.sonyericsson.com/wp/2011/07/26/get-your-apps-to-work-with-the-xperia%E2%84%A2-active-pressure-sensor/#more-3501

Questions regarding that blog post can be asked in this thread.
Kind regards
  /Johan, Sony Ericsson Developer program

-- 
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: Sony Ericsson Xperia Active-barometer sensor spec ?

2011-08-24 Thread Johan Abramsson
Hi,
Judging from the specs when I read them, the pressure sensor will
fulfill your requirements when it comes to measurement frequency and
the altitude range. I do however not think that it has the resolution
of 10 centimeters in altitude.

Kind regards
  /Johan, Sony Ericsson Developer Program

On Jul 3, 9:22 pm, PETR KALAFATIC petr.kalafa...@gmail.com wrote:
 Hi,
 I want to know some more info about the barometer.
 Full specifications would be useful (accuracy, range, measurement
 frequency...)
 I would like to use it for programming the altimeter/vario for
 paragliding , but it depends on the quality of the barometer.
 Perfect sensitivity would be measured every second, sensitivity of 10
 centimeters altimeter and altitude range of 0-3500 m above sea level.
 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] Unable to add window error in Android

2011-08-17 Thread Johan
I've tried different things, but I still keep the same error:

android.view.WindowManager$BadTokenException: Unable to add window  At
this line:

alertDialog.show();

Can you look at the code?

public class Main extends Activity implements Runnable {

private static final int STOPSPLASH = 0;
private ArrayListRssItem rssItems = new ArrayListRssItem();

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.splashscreen);

LoadData();
}

public void LoadData()
{
  Thread t1 = new Thread(this);
 t1.start();
}

private Handler handler = new Handler()
{
@Override
public void handleMessage(Message msg)
{
if(!rssItems.isEmpty())
{
switch (msg.what) {
case STOPSPLASH:
//remove SplashScreen from view
//splash.setVisibility(View.GONE);
Intent intent = new Intent(
news.displayNews);

intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP |
Intent.FLAG_ACTIVITY_CLEAR_TOP);
NewsDisplayer.rssItems.clear();
NewsDisplayer.rssItems.addAll(rssItems);

startActivity(intent);
Close();
break;
}
}
else
{
if (!isFinishing())
{
AlertDialog.Builder builder = new
AlertDialog.Builder(Main.this);
builder.setMessage(No connection.)
   .setTitle(error...)
   .setCancelable(false)
   .setPositiveButton(Again, new
DialogInterface.OnClickListener() {
   public void onClick(DialogInterface dialog, 
int id)
{
dialog.dismiss();
LoadData();
   }
   })
   .setNegativeButton(Close, new
DialogInterface.OnClickListener() {
   public void onClick(DialogInterface dialog, 
int id)
{
dialog.dismiss();
System.exit(0);;
   }
   });

AlertDialog alert = builder.create();
alert.show();
}
}
}
 };

-- 
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] Unable to add window error in Android

2011-08-17 Thread Johan
I've tried different things, but I still keep the same error:

android.view.WindowManager$BadTokenException: Unable to add window  --
token android.os.BinderProxy@40513880 is not valid; is your activity
running?

At this line: alertDialog.show();

Can you look at the code?



/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.splashscreen);

LoadData();
}

public void LoadData()
{
Thread t1 = new Thread(this);
t1.start();
}

private Handler handler = new Handler()
{
@Override
public void handleMessage(Message msg)
{
if(!rssItems.isEmpty())
{
switch (msg.what) {
case STOPSPLASH:
//remove SplashScreen from view
//splash.setVisibility(View.GONE);
Intent intent = new Intent(
news.displayNews);

intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP |
Intent.FLAG_ACTIVITY_CLEAR_TOP);
NewsDisplayer.rssItems.clear();
NewsDisplayer.rssItems.addAll(rssItems);

startActivity(intent);
Close();
break;
}
}
else
{
AlertDialog.Builder builder = new
AlertDialog.Builder(Main.this);
builder.setMessage(No conncection.)
   .setTitle(error...)
   .setCancelable(false)
   .setPositiveButton(Again, new
DialogInterface.OnClickListener() {
   public void onClick(DialogInterface dialog, 
int id)
{
dialog.dismiss();
LoadData();
   }
   })
   .setNegativeButton(Close, new
DialogInterface.OnClickListener() {
   public void onClick(DialogInterface dialog, 
int id)
{
dialog.dismiss();
System.exit(0);;
   }
   });

AlertDialog alert = builder.create();
alert.show();
}
}
 };

-- 
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] Discrepancy between streaming data over localhost vs WIFI network interfaces on 3.0

2011-07-15 Thread Johan Lindquist
Hi all,

I have written a proxy server which takes a remote HLS video and
simply streams the content to the MediaPlayer (running on a Galaxy Tab
10.1 - Android 3.0.1).Whatever request the MediaPlayer makes, the
proxy mirrors onto a remote web server.

I have noticed that the MediaPlayer will not play the video correctly
(it stops, as if buffering) when using the localhost (http://localhost
URL) but while binding the server to the WIFI interface (http://
172.30.17.X URL) it happily plays it.

Has anyone ever seen a discrepancy like this when using the different
interfaces?  Any ideas on how to resolve this?  Binding to the WIFI
address is of course OK in many cases but makes things a little tricky
when on 3G.  Any suggestions and or comments on this would be
appreciated!

Cheers,

Johan

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

2011-07-14 Thread Johan Abramsson
Hi Developers,
Some time ago  Sony Ericsson has released a utility tool called
AppXplore on Android market.
It is to be used by advanced users that wants to have a look inside
their android phones and check what the apps they have installed can
do to the phone with regards to permissions etc, and also find other
useful details of installed apps.

It can be downloaded for free from android market.
https://market.android.com/details?id=com.sonyericsson.androidapp.AppExplorefeature=search_result

Documentation is published on Sony Ericsson Developer World.
http://developer.sonyericsson.com/wportal/devworld/technology/android/analysis-tools/appxplore?cc=gblc=en

Questions and comments can be put as a reply on this news thread.
Kind regards
  /Johan

-- 
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: Sony Ericsson EDK for Timescape

2011-07-13 Thread Johan Abramsson
Hi Android Developers,
The second version of the Sony Ericsson EDK has been released today.
The news is that you can now create extension applications for the
Musicplayer on Sony Ericsson Android phones as well.
Or to be more exact – application that can hook in to the infinite key
of the music player.
It can, like before, also be used to create Timescape extensions for
all Sony Ericsson Android phones.
For further information please check this link:
http://developer.sonyericsson.com/edk

Questions can be posted to this thread.
Kind regards
   /Johan
Sony Ericsson Developer Program



On Jul 7, 8:42 am, Johan Abramsson johan.abrams...@sonyericsson.com
wrote:
 Hi there,

 Thanks for downloading theEDK, we hope you will find it useful. In
 our 2011 Android products the deep integration of Timescape was
 changed so that it is a standalone app, and in the same time we
 decided to specialise Timescape a little bit more also. Therefore, the
 email extensions were not part of this Timescape version. However, if
 you or any other developer would like to develop an extension for
 email client extensions, you are welcome!

 Feel free to submit any further questions about theEDKhere.

 Best regards,
 Johan

 On Jul 4, 10:16 pm, Rahul Popuri rahulpop...@gmail.com wrote:







  Hi Johan,
  I just downloaded theEDKtoday and played around with the RSS extension,
  looks really good!
  I was wondering, how come Sony Ericsson didn't include an email extension
  like they did with the 2010 Timescape?

-- 
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: Sony Ericsson EDK for Timescape

2011-07-07 Thread Johan Abramsson
Hi there,

Thanks for downloading the EDK, we hope you will find it useful. In
our 2011 Android products the deep integration of Timescape was
changed so that it is a standalone app, and in the same time we
decided to specialise Timescape a little bit more also. Therefore, the
email extensions were not part of this Timescape version. However, if
you or any other developer would like to develop an extension for
email client extensions, you are welcome!

Feel free to submit any further questions about the EDK here.

Best regards,
Johan

On Jul 4, 10:16 pm, Rahul Popuri rahulpop...@gmail.com wrote:
 Hi Johan,
 I just downloaded the EDK today and played around with the RSS extension,
 looks really good!
 I was wondering, how come Sony Ericsson didn't include an email extension
 like they did with the 2010 Timescape?

-- 
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: Image scaling on Sony Ericsson Xperia phone

2011-07-07 Thread Johan Abramsson
Hi,
I am glad you liked the article, Andreas has done a really great job.

I will forward your thoughts into the customer service organisation.
Thanks for letting us know.
Kind regards
  /Johan

On Jul 6, 8:37 pm, Martin Sall maris.seiman...@gmail.com wrote:
 Really nice article. It is great to see development related tutorials
 fromSonyEricssonlately.

 But I would like to ask about font scaling. I myself am visually
 impaired since birth (but still a software developer) and I know many
 people who wish to use Android devices but cannot do that comfortably
 because there is no font scaling built into the core of Android. This
 is also bad for people over 50 who do not have a perfect vision
 anymore.

 There is a 2 years old feature request on Android issue tracker, but
 it seems abandoned by 
 developers:http://code.google.com/p/android/issues/detail?id=4547

 Of course, each developer can make the fonts scalable, but they do so
 not often. The worst is that the basic phone functions (menu,
 contacts, SMS, mail) have too tiny texts.
 I myself am looking forward to buy SonyEricsson Neo, but I am afraid I
 won't be able to use it comfortably, I need a little bit bigger fonts
 everywhere and I would like avoid rooting the device just to do some
 hacky font replacement which would look ugly anyway.

 So if someone could bringSonyEricsson'sattention and ask them to
 develop more accessible software (just a basic home screen, contacts,
 SMS, menus), I guess,SonyEricssonwould get buyers from all the 50
 old people range + some bunch of people with impaired vision.

 I promise you,SonyEricsson: on the day you develop and release some
 software update which allows to scale fonts bigger on aSonyEricsson
 Neo phone, I'll buy it. For now I'll just read articles about Android
 development and use SDK/VirtualBox Android emulators.

 Please,SonyEricsson(and other developers, too), give a helping hand
 to visually impaired and not-so-young people.

 Good luck to all developers,
 Martin
 and some other visually impaired people.

 On 27 Jūn., 12:13, Johan Abramsson johan.abrams...@sonyericsson.com
 wrote:







  Hi,
  This article does, of course, apply to any android phone.
  Since we updated the blog post with a link to tis article the link to
  the blog post has changed. The new link is here,

 http://blogs.sonyericsson.com/wp/2011/06/27/how-to-scale-images-for-y...

  We apologize for any inconviniance.
  Kind regards
    /Johan

  On Jun 22, 10:07 am, Johan Abramsson

  johan.abrams...@sonyericsson.com wrote:
   Hi,

   Hard to get images scaled correctly for your application? Are your
   images too large and causing memory problems? Or are they scaled
   incorrectly with a poor user experience as a result?
   To find a good solution for this, we asked Andreas Agvard from the
  SonyEricssonsoftware department to help shed some light on this
   topic.

   More data and a good sample project are found 
   here:http://blogs.sonyericsson.com/wp/2011/06/13/how-to-scale-images-for-y...

   Comments and question ? Please direct them to this news thread.
   Kind regards
     /Johan

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


[android-developers] How to Adapt your apps for the new LiveSound™ hi-fi headset and the LiveDock™ multimedia station

2011-06-27 Thread Johan Abramsson
Sony Ericsson has announced the LiveSound™ hi-fi headset and the
LiveDock™ multimedia station. The LiveSound™ hi-fi headset is also the
first headset to support the new LiveKey™ feature which is a button on
the headset where you as developer can control your application.  You
can download the tutorial and sample code here:
http://developer.sonyericsson.com/wportal/devworld/technology/smart-extras/livekey?cc=gblc=en
The LiveDock™ multimedia station is a smart, new docking station for
your phone which will launch any application you have set in the
LiveWare™ manager application. As developer you can adapt your
application to start as soon you connect the phone to LiveDock™.  You
can download the tutorial and sample code here:
http://developer.sonyericsson.com/wportal/devworld/technology/smart-extras/connectlaunch?cc=gblc=en

Kind regards
  /Johan  Najat

-- 
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: Image scaling on Sony Ericsson Xperia phone

2011-06-27 Thread Johan Abramsson
Hi,
This article does, of course, apply to any android phone.
Since we updated the blog post with a link to tis article the link to
the blog post has changed. The new link is here,

http://blogs.sonyericsson.com/wp/2011/06/27/how-to-scale-images-for-your-android%E2%84%A2-application/

We apologize for any inconviniance.
Kind regards
  /Johan


On Jun 22, 10:07 am, Johan Abramsson
johan.abrams...@sonyericsson.com wrote:
 Hi,

 Hard to get images scaled correctly for your application? Are your
 images too large and causing memory problems? Or are they scaled
 incorrectly with a poor user experience as a result?
 To find a good solution for this, we asked Andreas Agvard from the
 Sony Ericsson software department to help shed some light on this
 topic.

 More data and a good sample project are found 
 here:http://blogs.sonyericsson.com/wp/2011/06/13/how-to-scale-images-for-y...

 Comments and question ? Please direct them to this news thread.
 Kind regards
   /Johan

-- 
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] Image scaling on Sony Ericsson Xperia phone

2011-06-22 Thread Johan Abramsson
Hi,

Hard to get images scaled correctly for your application? Are your
images too large and causing memory problems? Or are they scaled
incorrectly with a poor user experience as a result?
To find a good solution for this, we asked Andreas Agvard from the
Sony Ericsson software department to help shed some light on this
topic.

More data and a good sample project are found here:
http://blogs.sonyericsson.com/wp/2011/06/13/how-to-scale-images-for-your-android%E2%84%A2-application/#more-2596

Comments and question ? Please direct them to this news thread.
Kind regards
  /Johan

-- 
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: SE X10mini PRO message bug?

2011-05-16 Thread Johan Abramsson
Hi,
I did some doublechecking here - to start with,
this is really a bug in the phone, and I think that you will get quite
apropriate answers on SonyEricssons support site at:
http://talk.sonyericsson.com/community/support/

However I checked with development departments as well, and if you
provide us with a DDMS log from the time when the error occurs we can
analyze it from there.
Kind regards
  /Johan

On May 13, 5:57 am, Johan Abramsson johan.abrams...@sonyericsson.com
wrote:
 Hi,
 this is not something I know about from the top of my head - but I
 will check with development departments.
 Kind regards
   /Johan

 On May 3, 12:20 pm, Mulder5 roman.ga...@gmail.com wrote:







  Hello
  I have the latest system update ( 2.1.1.A.0.6 ) and I have problems
  with concepts and sometimes with sending forward messages.When I leave
  a concept in message and than I try to open it,it takes mi about 10
  times to open it,becouse it shows me that  The aplication Messages
  ( proces com.sonyericsson.conversations ) has crashed.Try again
   ( sorry for the word crashed but its the best translated
  meaning :-) ).It makes me every time when I leave a concept and its
  very annoying.It makes only sometimes when I send messages forward
  Thanks when you look at it

-- 
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: SE X10mini PRO message bug?

2011-05-12 Thread Johan Abramsson
Hi,
this is not something I know about from the top of my head - but I
will check with development departments.
Kind regards
  /Johan

On May 3, 12:20 pm, Mulder5 roman.ga...@gmail.com wrote:
 Hello
 I have the latest system update ( 2.1.1.A.0.6 ) and I have problems
 with concepts and sometimes with sending forward messages.When I leave
 a concept in message and than I try to open it,it takes mi about 10
 times to open it,becouse it shows me that  The aplication Messages
 ( proces com.sonyericsson.conversations ) has crashed.Try again
  ( sorry for the word crashed but its the best translated
 meaning :-) ).It makes me every time when I leave a concept and its
 very annoying.It makes only sometimes when I send messages forward
 Thanks when you look at it

-- 
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: Problem Sony Xperia Neo Camera zoom-support = false

2011-04-28 Thread Johan Abramsson
Hi,
Your phone does give you a correct answer. Zoom in the Camera API  is
not supported right now.
It will be supoprted in the 4.0.x.y.z Version of the phone software
which will be released by SonyEricsson during late Q2 according to the
present plans.

Kind regards
  /Johan
Sony Ericsson Developer Support

On Apr 27, 6:38 am, CG learn@gmail.com wrote:
 Hi all,
    I have a problem and hope that somebody who encountered this before
 can give me some hints..

 I am developing a app which use the camera on Sony Xperia Neo 
 (http://www.sonyericsson.com/cws/products/mobilephones/overview/xperia-neo?cc...)
 which support Camera Zooming.

 When I tried to check the Zoom Support using
 parameter.isZoomSupported() , it returns false which I think is
 wrong.

 I then try to check the HashMap in the Camera.parameter looking for
 the value of zoom-supported , and the value is also false.
 Besides, zoom=0, max-zoom

 Therefore, my app cannot control the zooming of the Camera preview
 because of this.

 I wonder why it happens ? is it because the Sony's SDK does not return
 the correct value ?

 The same code running on HTC wildfire  Nexus One do not have problem.

 Thanks in advanced for any help ..

 Development OS : Ubuntu 10.04

 Development SDK : 2.2

 Sony Xperia Android : 2.3

-- 
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] Sony Ericsson EDK for Timescape

2011-03-31 Thread Johan Abramsson
Hi Android Developers,

The development kit for Sony Ericsson Timescape extensions (the EDK)
is now available for download at http://developer.sonyericsson.com/edk
.

Regarding the installation: Finally are the relevant links on the site
working properly - and the EDK can now be installed using the proper
Android SDK Manager.

Go ahead and download the documentation and the rest of the kit and
try it out.

Questions regarding this EDK or Timescape application as such can be
sent to this thread.

Please note that the EDK is applicable for 2011 products.

Kind regards
  /Johan

-- 
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] DownloadManager lack of functionality. Bug or intentional limitation?

2011-02-22 Thread Johan Alva
Hi,

In gingerbread the public download api doesn't take care of duplicate
filenames and also no download directory is automatically created. Are
these behaviours intentional or just bugs?

As it is now the application requesting a download must itself make
sure:
1. That a download directory exists (and if not, create one)
2. That the wanted filename for the file to be downloaded doesn't
already exist (and if it exists, change filename)

So, does anyone know if there is a reason why the application needs to
handle these two things instead of the DownloadManager

big 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: App closes on load (reported only on LG Ally and X10 mini)

2011-02-14 Thread Johan Abramsson
Hi,
The Sony Ericsson X10 mini has screen size 240 * 320.
See 
http://developer.sonyericsson.com/wportal/devworld/phones/phone-overview/xperiax10mini?cc=gblc=en
for more information.

(Or check in this, more develpoer related link:
http://developer.sonyericsson.com/wportal/devworld/technology/android/developer-tools?cc=gblc=en
)

Kind regards
  /Johan

On Feb 3, 12:32 pm, fully degior...@gmail.com wrote:
 Hi My app has had a couple of complaints that it's not working with LG
 Ally nor the X10 mini, i created an emulator with a 480x800, 160
 density which it doesn't run on, I'm unaware of what the LG Ally
 density is but i am sure the res is correct?

 does the LG Ally have an irregular screen?

 can anyone tell my the force close would only happen on these mobiles?

 thanks in advance
 Fully

-- 
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: Orientation Problem in Camera.

2011-02-09 Thread Johan Abramsson
In the firmware 2.0.A.504 of Xperia X10 there seems to have sneaked in
a problem regarding usage of the undocumented orientation
parameters. That parameter is not correctly implemented. Work is
ongoing to solve this issue, (although it is not documented in the
android vanilla doc's) however I recommend to lock the activity in a
orientation mode in the mean time.

 
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);


Good luck.

  /Johan

On Jan 31, 1:27 pm, himen patel himen.pa...@gmail.com wrote:
 hi i am an android developer.

 i am making a camera application in android.
 i have a sony Experia X10. version 2.1
 i am launching a hardware camera. but when the
 preview is start it come with noise in portrait mode or 90 degree anti
 clockwise
 but in landscape it comes better.

 but if i checked same appliction in sony Experia X8. version 2.1
 preview comes good in both mode landscape or portrait.

 i can't understand where is the 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


[android-developers] Re: Optimal packaging of image app for various screen resolutions

2011-02-08 Thread Johan
Thanks Aleksandr and Sterling! Might be worth a shot!

On Feb 8, 10:54 am, String sterling.ud...@googlemail.com wrote:
 I don't think I would recommend separate APKs, actually. That'll inevitably
 cause confusion and problems for your users, as well as splitting whatever
 userbase you have across multiple packages, not good for your Market
 rankings.

 If you're not targeting Cupcake, a variation on Aleksandr's suggestion might
 work.: put all your images in -hdpi directories and let the system scale
 them for other densities. It generally does a better job downscaling than
 upscaling, for obvious reasons, so the results might be acceptable. Note
 that I haven't tried this, but it seems plausible.

 String

-- 
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] Optimal packaging of image app for various screen resolutions

2011-02-07 Thread Johan
Hi there,

I'm working on an app which displays various images. I want to
optimize this for the various screen resolutions. The MultiResolution
(1) tutorial uses many resource qualifiers in the res folder to
display the appropriate images for the various device resolutions, but
how do you package this? I don't want to ship the images for all
devices (or do I?). I want to keep the download size as small as
possible, so I only want to package the ones for that particular
screen resolution. Or, should I forget packaging images and put the
images on-line somewhere?

Any opinions on this subject would be appreciated

(1) http://developer.android.com/resources/samples/MultiResolution/index

-- 
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: Optimal packaging of image app for various screen resolutions

2011-02-07 Thread Johan
Hi Sterling,

Thanks for your answer (and I added a vote to your feature request
since it perfectly describes the trouble at hand ;-).

So you agree that with an image-heavy app splitting up into various
apk's is good practice, but there currently aren't any good tools for
it? Hmm... maybe I'll have write my own build scripts with something
like AndroidAnt (http://code.google.com/p/autoandroid/wiki/AndroidAnt)
or does anybody have another good build-your-own-android-build-script
alternative?

Cheers,

Johan

On Feb 8, 4:48 am, String sterling.ud...@googlemail.com wrote:
 Unfortunately, there's no way to avoid duplication with the current
 architecture, AFAIK. You can sometimes use some redirection to reuse a given
 image for, say, both -large and -hdpi, but that's about it. In my
 experience, this is one big reason for APK bloat.

 Long ago, I submitted a feature request to address this issue 
 (http://code.google.com/p/android/issues/detail?id=5207), but right now it
 only has 2 stars and hasn't even been acknowledged by the platform team.

 String

-- 
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: Capture image with Intent

2011-01-27 Thread Johan Abramsson
Hi,
We aer aware of this problem.
Try this approach to work around:
To get the full size picture you can do like this:

 private void launchStillPictCamera(){
  Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

try {
startActivityForResult(intent, 42);
} catch (ActivityNotFoundException e) {
//Do nothing for now
}


 }

and upon activity result:
 @Override
 protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
  super.onActivityResult(requestCode, resultCode, data);

  switch (resultCode) {
  case RESULT_OK:
   if (requestCode == 42) {
String photoPath = null;

   if(data!=null  data.getData()!=null) {
Uri photoUri = data.getData();
 String[] projection =
{ MediaStore.Images.ImageColumns.DATA };
 Cursor c = managedQuery(photoUri, projection,
null, null, null);
 if (c!=null  c.moveToFirst()) {
  photoPath = c.getString(0);
 }
 Log.v(PhotoPath, photoPath);

//And now the photo can be copied or moved as of your own choice using
output/input streams of your own choice
   }

   } else {
System.out.println(Yada request code NOK);
   }
   break;
  default:
   System.out.println(Result NOK);
  }

 }

Kind regards
  /Johan

On Jan 1, 7:55 pm, Nikola nikola1...@gmail.com wrote:
 New phones tested.

  Running on following phones:

  1) SonyEricsson X8 (E15i) OS: Android 2.1 update 1
  2) SonyEricsson X10i OS: Android 2.1 update 1

  3) Galaxy  i9000 2.2 jpo

 4) Htc Desire HD froyo 2.2



  Phone 1 works fine. Preview is visible and picture is created.

  Phone 2 doesn't work at all, doesn't create picture, there is no preview.

 Phone 3 works fine.
 Phone 4 works fine.

 --
 God is Real, unless declared Integer.
 J. Allan Toogood, FORTRAN programmer

-- 
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: Customized AnalogClock widget doesn't survive screen orientation change

2011-01-27 Thread Johan Abramsson
Hi Alexander,
I am certainly not especially good at widgets, but in this case it
looks as if you have some problems with the xml defiining either the
widget or most probably the layout when going to landscape.
Good luck
  /Johan

On Jan 22, 9:05 am, Alexander Golikov agoliko...@gmail.com wrote:
 Hello,

 I've created a simple analog clock widget for SonyEricsson X10 mini
 pro. It just changes the style of standard android AnalogClock widget.
 Widget works fine until screen orientation changes when I slide the
 physical keyboard. At this moment I recieve the following error:

 W/AppWidgetHostView( 1305): updateAppWidget couldn't find any view,
 using error
 view
 W/AppWidgetHostView( 1305): android.view.InflateException: Binary XML
 file line
 #12: Error inflating class android.widget.AnalogClock
 W/AppWidgetHostView( 1305):     at
 android.view.LayoutInflater.createView(Layout
 Inflater.java:513)
 W/AppWidgetHostView( 1305):     at
 com.android.internal.policy.impl.PhoneLayoutI
 nflater.onCreateView(PhoneLayoutInflater.java:56)
 W/AppWidgetHostView( 1305):     at
 android.view.LayoutInflater.createViewFromTag
 (LayoutInflater.java:563)
 W/AppWidgetHostView( 1305):     at
 android.view.LayoutInflater.rInflate(LayoutIn
 flater.java:618)
 W/AppWidgetHostView( 1305):     at
 android.view.LayoutInflater.inflate(LayoutInf
 later.java:407)
 W/AppWidgetHostView( 1305):     at
 android.view.LayoutInflater.inflate(LayoutInf
 later.java:320)
 W/AppWidgetHostView( 1305):     at
 android.widget.RemoteViews.apply(RemoteViews.
 java:900)
 W/AppWidgetHostView( 1305):     at
 android.appwidget.AppWidgetHostView.updateApp
 Widget(AppWidgetHostView.java:208)
 W/AppWidgetHostView( 1305):     at
 android.appwidget.AppWidgetHost.createView(Ap
 pWidgetHost.java:217)
 W/AppWidgetHostView( 1305):     at
 com.sonyericsson.homescreen.HomeScreen.create
 AppWidget(HomeScreen.java:1026)
 W/AppWidgetHostView( 1305):     at
 com.sonyericsson.homescreen.HomeScreen.access
 $3100(HomeScreen.java:105)
 W/AppWidgetHostView( 1305):     at
 com.sonyericsson.homescreen.HomeScreen$Widget
 LoaderThread.run(HomeScreen.java:2423)
 W/AppWidgetHostView( 1305): Caused by:
 java.lang.reflect.InvocationTargetExcepti
 on
 W/AppWidgetHostView( 1305):     at
 android.widget.AnalogClock.init(AnalogClock
 .java:62)
 W/AppWidgetHostView( 1305):     at
 java.lang.reflect.Constructor.constructNative
 (Native Method)
 W/AppWidgetHostView( 1305):     at
 java.lang.reflect.Constructor.newInstance(Con
 structor.java:446)
 W/AppWidgetHostView( 1305):     at
 android.view.LayoutInflater.createView(Layout
 Inflater.java:500)
 W/AppWidgetHostView( 1305):     ... 11 more
 W/AppWidgetHostView( 1305): Caused by: java.lang.RuntimeException:
 Can't create
 handler inside thread that has not called Looper.prepare()
 W/AppWidgetHostView( 1305):     at
 android.os.Handler.init(Handler.java:121)
 W/AppWidgetHostView( 1305):     at
 android.widget.AnalogClock.init(AnalogClock
 .java:52)
 W/AppWidgetHostView( 1305):     ... 15 more

 My code is here:

 public class ClockWidget extends AppWidgetProvider
 {
     public void onReceive(Context context, Intent intent)
     {
         String action = intent.getAction();
         if (AppWidgetManager.ACTION_APPWIDGET_UPDATE.equals(action))
         {
             RemoteViews views = new
 RemoteViews(context.getPackageName(), R.layout.widget);
 AppWidgetManager.getInstance(context).updateAppWidget(intent.getIntArrayExt­ra(AppWidgetManager.EXTRA_APPWIDGET_IDS),
 views);
         }
     }

 }

 And layout file is as follows:

 ?xml version=1.0 encoding=utf-8?
 RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
 android
                                 android:id=@+id/Widget
                                 android:layout_width=fill_parent
                                 android:layout_height=fill_parent
                                 android:gravity=center
         AnalogClock android:saveEnabled=true android:id=@+id/AnalogClock
 android:layout_width=wrap_content
 android:layout_height=wrap_content android:dial=@drawable/
 widgetdial android:hand_hour=@drawable/widgethour
 android:hand_minute=@drawable/widgetminute/
 /RelativeLayout

 Could you please advise what can cause such problem.

 Thanks,
 Alexander

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


[android-developers] How to optimize an image app for various devices and screen resolutions

2011-01-12 Thread Johan
Hi there,

I'm working on an app which displays various images. I want to
optimize this for the various screen resolutions. The MultiResolution
(1) tutorial uses many resource qualifiers in the res folder to
display the appropriate images for the various device resolutions, but
how do you package this? I don't want to ship the images for all
devices (or do I?). I want to keep the download size as small as
possibel, so I only want to package the ones for that particular
screen resolution. Or, should I forget packaging images and put the
images on-line somewhere?

Any opinions on this subject would be appreciated

(1) http://developer.android.com/resources/samples/MultiResolution/index.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] Re: How to tell if phone is Android configured?

2011-01-03 Thread Johan Abramsson
Hi,
What model is it ? What is it called ? Most current Xperias (x10/X10
mini/pro) are Android - but their are also two windows mobile ones,
(X1 and X2)
Kind regards
  /Johan

On Dec 16 2010, 8:09 pm, MrUmunhum mrumun...@cruzio.com wrote:
 Hi group,

  I just was given a phone that is said to support Android? How can I
 tell??
 It is aSonyEricssonXperia. If it dows support Android, how do I
 update it?

-- 
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] Sony Ericsson LiveView™ micro display SDK upgrade is released

2010-12-20 Thread Johan Abramsson
Due to a design error in the LiveView SDK, there is a risk that the
plug-in icon of one installed plug-in can be overwritten by another
installed plug-in. I.e. the same icon file is used on the SD card. The
design error has been fixed and published on Sony Ericsson Developer
World.

Please go to 
http://developer.sonyericsson.com/wportal/devworld/downloads/download/liveviewmicrodisplaysdk
to get the latest version of the SDK.

Best regards
  /Johan

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


  1   2   >