[android-developers] Re: Cannot resolve symbol "r" on android studio

2017-01-17 Thread Derek Saam
I had a similar problem, for me in the end there was a typo in my 
AndroidManifest.xml file, specifically in the package name, I had an extra 
period in there. the compiler didn't pick up on it. It took me a long time 
to find this typo as nothing in the error logs pointed me that way, it just 
kept telling me it couldn't resolve R. It was a hard one to debug.

On Thursday, September 8, 2016 at 8:55:59 AM UTC-7, Albert Muñoz wrote:
>
> I'm doing on UDACITY the android development for begginers course and in 
> one exercice we must put this code o the activity_main.xml:
>
>
> 
> http://schemas.android.com/apk/res/android;
> xmlns:tools="http://schemas.android.com/tools;
> android:orientation="vertical"
> android:layout_width="match_parent"
> android:layout_height="match_parent"
> android:paddingBottom="@dimen/activity_vertical_margin"
> android:paddingLeft="@dimen/activity_horizontal_margin"
> android:paddingRight="@dimen/activity_horizontal_margin"
> android:paddingTop="@dimen/activity_vertical_margin"
> tools:context="com.example.android.justjava.MainActivity">
>
>  android:id="@+id/quantity"
> android:layout_width="wrap_content"
> android:layout_height="wrap_content"
> android:text="Quantity"
> android:textAllCaps="true"/>
>  android:id="@+id/number_quantity"
> android:layout_width="wrap_content"
> android:layout_height="wrap_content"
> android:text="0"
> android:textColor="#00"
> android:textSize="16sp"
> android:paddingTop="16dp"
> android:paddingBottom="16dp"/>
>  android:layout_width="wrap_content"
> android:layout_height="wrap_content"
> android:text="ORDER"
> android:OneClick="submitOrder"
>
> />
> 
>
>
>
>
>
>
>
>
>
>
>
> and on the MainActivity.java this code:
>
>
>
>
>
>
>
>
> /**
>
>  * Add your package below. Package name can be found in the project's 
> AndroidManifest.xml file.
>
>  * This is the package name our example uses:
>
>  *
>
>  * package com.example.android.justjava;
>
>  */
>
>
>
> import android.os.Bundle;
>
> import android.support.v7.app.AppCompatActivity;
>
> import android.view.View;
>
> import android.widget.TextView;
>
>
> /**
>
>  * This app displays an order form to order coffee.
>
>  */
>
> public class MainActivity extends AppCompatActivity {
>
>
>
> @Override
>
> protected void onCreate(Bundle savedInstanceState) {
>
> super.onCreate(savedInstanceState);
>
> setContentView(R.layout.activity_main);
>
> }
>
>
>
> /**
>
>  * This method is called when the order button is clicked.
>
>  */
>
> public void submitOrder(View view) {
>
> display(1);
>
> }
>
>
> /**
>
>  * This method displays the given quantity value on the screen.
>
>  */
>
> private void display(int number) {
>
> TextView quantityTextView = (TextView) 
> findViewById(R.id.quantity_text_view);
>
> quantityTextView.setText("" + number);
>
> }
>
> }
>
>
>
>
>
>
>
> And on the MainActivity.java code the R is in red and i don't understand 
> why???
>
> I've tryed to clean the project, build the project and changing the code but 
> i cannot resolve the problem.
>
> Please HELP ME!
>
>

-- 
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/b2eab2ca-aa1d-42ac-ba80-dfb2cf20729b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] "Sign-in to network" panel not fully functional

2016-06-08 Thread Derek Ferguson
Not sure if I’m on-topic here or not, but here goes... I am responsible for 
the setup/configuration of WiFi routers in various restaurants and venues. 
We are simply using the built-in splash page functionality of the router 
to, upon connection, present a simple marketing message and daily special 
offer via an extremely simple, static external HTML page, rather than the 
login page that many venues present (airports, coffee shops, McDonalds, 
etc.).

After connecting to our SSID with a PC or mobile device, users are 
presented with a customized splash page where our venue’s latest “offer of 
the day” banner ad is presented, which links via a standard hyperlink out 
to a PDF coupon for them to redeem said offer. There are also a couple of 
other simple items on the page, such as a menu with links to other offers, 
and an embedded Google Map to the venue in question.

All seems to be OK on PCs and iPad/iPhone devices. However, we are running 
into a problem on Android devices – specifically, Android devices using 
newer/more recent versions of the Android OS.

The problem is that Google has made a change to newer versions of Android 
so that WiFi connection login/splash/confirmation pages no longer come up 
in the default Web browser of the phone/tablet in question. Instead, they 
seem to come up in some kind of built-in notification window simply titled 
“Sign-in to network” – it does not seem to be a full-blown, 
feature-compliant browser, but rather a panel of sorts built into Android. 
And when our basic, mainly static HTML page loads within this alert window, 
none of the standard HTML features (such as hyperlinks) seem to work. A 
window appears with the title “Sign-in to network”, and our splash page 
appears on within it, but the standard HTML hyperlink from our special 
offer graphic (to a PDF file) does not work. Clicking it has no effect. Our 
menu underneath that does not seem to open (it’s automatically collapsed on 
mobile devices), and none of the links within it work properly, and our 
embedded Google Map does not appear at all. It’s as if this alert window or 
whatever we call it does not support the basic features of HTML pages in 
any way.

An example of one of our splash pages is located at: 
http://landing.airwifi.network/bigbossburgers/invite-offer-free-2nd-beer 
(just so you can see how simple it is). It will work fine in a standard 
browser, but will not function when presented within the “Sign-in to 
network” notification display panel for Android users who connect to our 
router devices. Unfortunately, you can only experience this when connecting 
locally.

There appears to be no way for me to programmatically force the Android 
client to “escape” from this proprietary panel and open up a page in their 
default browser. I’ve tried placing various forms of client and server side 
“push/redirect” code on the page in an effort to escape from this alert 
window and cue the default browser to open, with no luck. No matter what I 
do, it seems that they Android phones always load the splash page within a 
“sign-in to network” notification page rather than a browser, and that this 
notification panel is not fully functional for even basic HTML features 
such as  hyperlinks, javascript, or embedded items.

It’s possible that Android’s proprietary “sign-in to network” panel is 
apparently seeking some sort of acknowledgement of a successful "login" in 
order to proceed with any subsequent browsing. But if so, I don’t know what 
constitutes “acknowledgement”. Perhaps there some way to force a hidden 
form submission or link click programmatically to force the Android device 
to accept/acknowledge the connection just as if the user had logged in 
normally, so that we can then proceed to subsequent Web browsing?

Has anyone experienced this problem, or have any ideas as to whether 
there’s a work-around or coding-based solution to this difficulty? 
Thanks very much for your help in advance.

-- 
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/17633662-69c7-4714-95c4-a264fdf6cf6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Touch Gestures not working (Arnova 7FG3 Tablet, running ICS 4.0.3)

2012-11-14 Thread Derek Bradshaw
I just bought a 7 Android 4.0.3 tablet for developing and testing custom 
web apps but none of the touch gestures are firing? The demo i'm looking at 
is: http://riagora.com/mobile/hammer/
Unfortunately nothing happens when I touch the screen, whereas on the iPad, 
it works a treat! Really smooth!

I have also tried the demo at Hammer.js 
http://eightmedia.github.com/hammer.js/Same thing!

Anybody have any idea what's going on? It's really frustrating! As I said, 
these demos work perfectly on the iPad, and also on my smartphone 
(android2.2). It appears that the OS is somehow blocking the custom events 
from firing

Cheers!
D 

-- 
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 Hardware Acceleration crash or display issues

2011-12-23 Thread Derek
Hi all,

Many apps are facing display issues (or crash) when 2D GPU rendering
is enabled on real devices. How can we test this feature is ICS
emulator?
Is it true that it cannot be tested in Emulator?
http://stackoverflow.com/questions/7831865/where-is-the-hardware-acceleration-in-the-ics-emulator

We've tried to enabled in Settings-Developer without success. Apps
are working fine but users complains on real devices.

Thanks.

On Dec 6, 4:49 pm, webmonkey webmonke...@gmail.com wrote:
 Hi Romain

  You can easily check whether your app ishardwareaccelerated on
  startup and warn the user it's not supported.

 Eh, how do you easily check for that at startup, I found

 View.isHardwareAccelerated()
 Canvas.isHardwareAccelerated()

 But you can't use them at startup, am I missing something?

 I really hope you remove the Force GPU setting from future release
 build ofICS. You used to have a special Developer app for these
 things.

 On Dec 5, 7:01 pm, Romain Guy romain...@android.com wrote:

  This setting is unfortunately a double-edged sword, it was intended for
  developers so they could easily test their application withhardware
  acceleration turned on.

  You can easily check whether your app ishardwareaccelerated on startup
  and warn the user it's not supported.

  On Mon, Dec 5, 2011 at 9:21 AM, Mark Murphy mmur...@commonsware.com wrote:
   On Mon, Dec 5, 2011 at 12:04 PM, webmonkey webmonke...@gmail.com wrote:
I see now that there are some websites that advise people to turn it
on because it makes everything run smoother.

   Got any links? At least we can work on trying to get these posts
   updated, particularly if there's no SDK means of telling Android no
   means no when it comes to the Force GPU setting (and I see nothing in
   the SDK that looks promising).

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

   Warescription: Three Android Books, Plus Updates, One Low Price!

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

  --
  Romain Guy
  Android framework engineer
  romain...@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-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: onFling() Question

2011-12-13 Thread Derek Winstead
Does anyone have any help for this? I don't know enough about Android to 
look in ViewGroup.OnInterceptTouchEvent and know what I'm looking at.

Is there a working model somewhere that I can see how it happens? Or at 
least an explanation of why I need to use something.

Sorry for the lack of knowledge on this, but I've been struggling with this 
part for months now.

Thanks,
Derek

-- 
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] onFling() Question

2011-12-09 Thread Derek Winstead
I have an activity that implements GestureDetector.OnGestureListener.

This variable: GestureDetector gestureDetector = new GestureDetector(this).

This @Override public boolean onTouchEvent(MotionEvent event) { return 
gestureDetector.onTouchEvent(event); }

My application works as expected using the onFling() when I swipe the 
screen where there are no views or other layouts (empty spaces on the 
screen). But once I try to swipe over my views (bunch of TextViews and a 
Button) the onFling() is never called.

How would I go about this to make the onFling() available anywhere on the 
screen they swipe? I have searched for answers on Google with nothing that 
addresses this that I can tell.

Thanks for any help,
Derek

-- 
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: onFling() Question

2011-12-09 Thread Derek Winstead
Is there an example of this in action?

SDK's aren't very helpful to me. I'm still new to programming Android or 
Java.

Thanks,
Derek

-- 
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] HTML 5 (PhoneGap) In App Purchases

2011-11-03 Thread Derek Holmes
I'm developing using Phone Gap / HTML 5.

I would like to use an In app purchase system instead of a free / paid
version. I'm not seeing a way to implement this with an html 5
project.

I can use paypal but would this be rejected and violate the market
terms?

Thanks!

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


Re: [android-developers] Re: Activity Help

2011-09-23 Thread Derek Winstead
My SQL queries are fine, I copy and paste the queries into SQLite Database 
Browser with the current database that is on the VM. Runs fine and returns 
the results expected.

If it was a SQL error wouldn't the program error out before finishing the 
load? No breakpoints get hit on my debug mode and the layout loads with the 
data filled in on the VM. It's after everything runs I then get the error.

Any thoughts about that?

-- 
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: Activity Help

2011-09-23 Thread Derek Winstead
I changed the name of my variable in the fetchLiteratureTypes function on 
the LiteratureEditor.java file so it wasn't the same as the one in the 
LiteratureManager.java.

That seemed to work and fix my problem. I no longer error when running my 
app.

I assume it had something to do with the variable name being used in the 
previous activity since I never called finish() on the activity when calling 
the next Intent.

Thanks for the help everyone!

-- 
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] Activity Help

2011-09-21 Thread Derek Winstead
Hello all,

I have an issue where my activity has a spinner up top to change the 
listview below it with data from the sqlite database. Using this activity 
everything works fine. However, when I click on one of the list items it 
runs the next activity intent and after this new activity finishes loading 
(layout and java file completes) it throws a nullPointerException.

If I comment out my spinner and default the list to a number that the 
spinner would pass in and click on the list item, the next activity works 
just fine with no errors. This makes me believe it has something to do with 
my spinner and how it closes out or something. Honestly I have no idea and I 
cannot figure out why it throws this error.

Is there anything wrong with my code? Please, any and all help would be 
greatly appreciated!

Thanks in advance,
Derek

-- 
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=enpackage com.myMinistry.gui;

import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.SimpleCursorAdapter;
import android.widget.Spinner;
import android.widget.AdapterView.OnItemSelectedListener;

import com.myMinistry.R;
import com.myMinistry.db.LiteratureNameColumns;
import com.myMinistry.db.LiteratureTypeColumns;
import com.myMinistry.db.MinistryDatabase;
import com.myMinistry.models.LiteratureName;

public class LiteratureEditor extends Activity {
	private MinistryDatabase database;
	private LiteratureName _literatureName = new LiteratureName();
	private EditText literatureTitle;
	private Spinner literatureTypes;
	private int literatureNameID = 0;
	private int position = 0;

	@Override
	public void onResume() {
	super.onResume();
	fetchLiteratureTypes();
}
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	Bundle extras = getIntent().getExtras();
	setContentView(R.layout.literature_editor);

	if(extras != null) {
		Object[] keys = extras.keySet().toArray();
		
		for(int i = 0; i  keys.length; i++) {
			if(keys[i].toString().equals(literatureNameID))
				literatureNameID = extras.getInt(literatureNameID);
			if(keys[i].toString().equals(position))
				position = extras.getInt(position);
		}
	}
	
	database = new MinistryDatabase(this);
	database.open();
	
	if(literatureNameID  0) {
		Cursor record = database.fetchRecord(MinistryDatabase.LIT_NAMES_TABLE_NAME, new String[] {LiteratureNameColumns._ID,LiteratureNameColumns.PUBLISHER_ID,LiteratureNameColumns.NAME,LiteratureNameColumns.TYPE_ID,LiteratureNameColumns.ACTIVE,LiteratureNameColumns.COUNT_WEIGHT,LiteratureNameColumns.SORT_ORDER}, LiteratureNameColumns._ID, literatureNameID);
		if(record.moveToFirst())
			_literatureName = new LiteratureName(record);
	}
	
	literatureTypes = (Spinner) findViewById(R.id.literatureTypes);
	literatureTitle = (EditText) findViewById(R.id.literatureTitle);
	literatureTitle.setText(_literatureName.getName());
	
	findViewById(R.id.cancel).setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
finish();
			}
		});
	
	findViewById(R.id.save).setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
if(literatureTitle.getText().length()  0) {
	_literatureName.setName(literatureTitle.getText().toString());
	_literatureName.save();
			finish();
}
// Failure
else
	literatureTitle.setError(Please enter a title.);
			}
		});
}
	
	private void fetchLiteratureTypes(){
		Cursor litTypes = database.fetchRecords(MinistryDatabase.LIT_TYPES_TABLE_NAME, null, LiteratureTypeColumns.ACTIVE + =1, null, null, null, LiteratureTypeColumns.SORT_ORDER + , + LiteratureTypeColumns.NAME, null);
	SimpleCursorAdapter adapter = new SimpleCursorAdapter(getApplicationContext(), android.R.layout.simple_spinner_item, litTypes, new String[] {LiteratureTypeColumns.NAME}, new int[]{android.R.id.text1});
		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		literatureTypes.setAdapter(adapter);
		literatureTypes.setOnItemSelectedListener( new litTypeSelector() );
		literatureTypes.setSelection(position);
	}
	
public class litTypeSelector implements OnItemSelectedListener {
		public void onItemSelected(AdapterView? parent, View view, int pos, long id) {
			_literatureName.setTypeID((int)id);
			position = pos;
		}
		public void onNothingSelected(AdapterView? parent) {
			// Do nothing.
		}
	}
}package com.myMinistry.gui;

import

[android-developers] Re: Activity Help

2011-09-21 Thread Derek Winstead
It starts in the LiteratureManager.java and the intent goes to 
LiteratureEditor.java

-- 
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: Activity Help

2011-09-21 Thread Derek Winstead
Thanks Richard,

I have directly skipped the LiteratureManager.java and run the intent 
LiteratureEditor.java from an activity before that normally calls the 
manager file. The editor works just fine and doesn't crash.

I will post a stack trace tomorrow when I'm at work and can run the 
program... This leads me to another question that has stopped any 
development on my laptop at home (I didn't upgrade my work computer).

I have upgraded the SDK and AVD to to most recent release, which has broken 
my build. Seems the code:
 

style name=WindowTitleBackground parent=android:WindowTitleBackground
item name=android:background@android:color/transparent/item
/style


breaks my build. I read that I am calling android:WindowTitleBackground 
which was wrong to begin with and Google fixed this in the most recent 
release. I have no idea how to fix this and make my app work with the newest 
SDK/AVD release. I am a novice to Java and Android so this is a foreign 
problem.

I have my source publicly hosted by Google if you want to check it out and 
see for yourself.

http://code.google.com/p/myministryapp/source/checkout

Thanks for the help!

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

[android-developers] Advice Making a Coloring Book Application

2011-08-24 Thread Derek Rogers
Hello,

I'm in the process of making a coloring book application that is
basically a drawing application. I have been trying to make this
application using SurfaceView and the canvas. My first attempt using
Path and Paint has been successful and looks fine, but I would like to
make the paths that I draw with my finger look more like I was drawing
with a crayon.

The first thing I have done is to record my movemnts accross the
canvas and save those to an ArrayList. When View's onDraw function is
called the function reads the points and draws a bitmap to each point.
This method get problematic when the number of points grows larger.
The onDraw function slows down, and the application throws a force
error when the ArrayList gets to big.

I really feel that there are better methods to making a drawing
application with a textured brush that I have been unable to find. I'm
starting to also wonder if using OpenGL would be better.

I'm new to developing for Android and would love any advice anyone can
share with me about best practices for making a drawing application
with different brush styles.

Thanks so much for any help you can give,

Derek

-- 
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: NullPointerException in java.io.File.fixSlashes?

2011-06-06 Thread Derek
There are hundreds reports in Crash section of Android Market. Line is
not the same. Here they are:

java.lang.NullPointerException
at java.io.File.fixSlashes(File.java:234)
at java.io.File.init(File.java:201)
at java.io.File.init(File.java:152)

java.lang.NullPointerException
at java.io.File.fixSlashes(File.java:205)
at java.io.File.init(File.java:189)
at java.io.File.init(File.java:139)

java.lang.NullPointerException:
  at java.io.File.fixSlashes(File.java:267)
  at java.io.File.init(File.java:131)

We're going to try to pass new File(null) to see if it can be the
problem.






On Jun 5, 4:49 pm, Mark Murphy mmur...@commonsware.com wrote:
 Well, line 234 of File.java is not in thefixSlashes() method in the
 latest stuff in the repo, based on what Google Code Search is telling
 me.

 What are the models of devices that are giving you this problem?



 On Sun, Jun 5, 2011 at 10:21 AM, Derek cram.de...@gmail.com wrote:
  Hi all,

  We get crash reports with the following error:
  java.lang.NullPointerException
  at java.io.File.fixSlashes(File.java:234)

  It appears on File file = new File(path/subfolder);
  on some devices only.

  We cannot reproduce it. Where could this problem from from?

  Cheers.

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

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

 Android 3.0 Programming Books:http://commonsware.com/books

-- 
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] NullPointerException in java.io.File.fixSlashes?

2011-06-05 Thread Derek
Hi all,

We get crash reports with the following error:
java.lang.NullPointerException
at java.io.File.fixSlashes(File.java:234)

It appears on File file = new File(path/subfolder);
on some devices only.

We cannot reproduce it. Where could this problem from from?

Cheers.


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


[android-developers] Updated .apk wants uninstall first

2011-04-30 Thread Derek Winstead
I have been developing an app I want to share with friends and family for 
beta testing before I publish it to the android market. Problem is, since 
I've already had them install a previous version of the app, that when I 
send them the new .apk to install the installer wants the already installed 
app to be uninstalled first before the new version can be installed or 
updated.

Is this something I'm doing wrong in my program? I want the SQLite DB to 
always be intact and never loose data which is what happens when someone has 
to reinstall/update the app.

Please help! Thanks so much.

Derek

-- 
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] Updated .apk wants uninstall first

2011-04-30 Thread Derek Winstead
Where do I change the cert? That doesn't sound like something I've done 
(knowingly).

When doing my development on the ADV with eclipse I make my changes and 
rerun the program. It reinstalls everything but I don't loose data. Only 
when I try to push it to a real phone does it want an uninstall.

-- 
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: Updated .apk wants uninstall first

2011-04-30 Thread Derek Winstead
Ok, so when I right click my project and Run As - Android Application it 
installs on the VM but also creates the .apk file in the bin folder and that 
is what I'm coping and sending to friends. Is this incorrect to do?

I'm still a novice with Android.

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

[android-developers] Re: Updated .apk wants uninstall first

2011-04-30 Thread Derek Winstead
I checked out this: 
http://developer.android.com/guide/publishing/app-signing.html#releasemode

I created a keytool as the example shows. I have now Right Click Project - 
Export and put in the new keystore and alias on the export. I need to first 
write down everything on my phones version. Then uninstall and reinstall the 
new .apk created. Then I will make random changes to the app and do another 
export and install and see what happens.

Thanks everyone for the help so far in getting me in the right direction.

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

Re: [android-developers] How to develop a wheather forcast application for android

2011-04-21 Thread Derek Burnett
Unless you are going to forcast the weather yourself, look for a webservice
that provides weather forcasts as an RSS feed.  Open a socket to this
service and do an HTTP get.  Parse the XML and then display it in a neat
little view.

On Wed, Apr 20, 2011 at 1:47 AM, sanjay hello.sanja...@gmail.com wrote:

 Hi all,

 i m new in this field. So plese help.
 How to develop a wheather forcast application for android

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

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

Re: [android-developers] How to develop a wheather forcast application for android

2011-04-21 Thread Derek Burnett
Oh, and the first rule of writing a weather forcast application: learn how
to spell weather.

On Wed, Apr 20, 2011 at 1:47 AM, sanjay hello.sanja...@gmail.com wrote:

 Hi all,

 i m new in this field. So plese help.
 How to develop a wheather forcast application for android

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

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

[android-developers] App function help

2011-03-08 Thread Derek Winstead
I am not sure this is the right place/group to post this but I am looking for a 
way to respond to incoming phone calls with a text (canned response is fine).

I have the app Locale with the calendar plugin. I would like to know I'm 
receiving a call and respond to that call with a text saying I'm in a meeting, 
call you shortly.

Is this an option available using other plugins for Locale? I've seen somewhat 
similar using the app Taskr.

Please let me know my options.

Derek

-- 
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] TLS socket reuse hangs on device (works in emulator)

2011-01-09 Thread Derek
Hi all,

We're trying to reuse an existing plain socket with TLS for FTPES
purposes:
SSLSocket socket = (SSLSocket) ssf.createSocket(_socket_, ip, port,
true);
and it hangs on:
socket.startHandshake();
See full code snippet below.

This code works fine on emulator (Android 2.2) but it fails on
NexusOne device.
Creating a TLS socket from scratch (without reuse) works perfect on
both.

What could be the problem?

Code snippet:
plainSocket = _socket_; // plain socket works fine.
initSslContext(); // No problem here
SSLSocketFactory ssf = context.getSocketFactory();
String ip = _socket_.getInetAddress().getHostAddress();
int port = _socket_.getPort();
SSLSocket socket = (SSLSocket) ssf.createSocket(_socket_, ip,
port, true);
socket.setEnableSessionCreation(true);
socket.setUseClientMode(true);
if (protocols != null) socket.setEnabledProtocols(protocols);
if (suites != null) socket.setEnabledCipherSuites(suites);
socket.startHandshake(); // Hangs here

Cheers.

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


[android-developers] Multiple TextViews Inside a Button

2010-12-19 Thread Derek Winstead
I want to make a button like the ones in the LinkedIn beta app. The
buttons that say Connections and then on the right has the count of
your connections.

To me this looks like a button with two textviews inside it. Is that
even possible. I tried creating that and got errors at runtime. Do I
need to create style for a layout that looks like a button and put the
two textviews inside there and have the layout do the onClick()
events? This seems like a hack to me, but I wanted to know if anyone
else has a solution for this.

Thanks,
Derek

-- 
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: Multiple TextViews Inside a Button

2010-12-19 Thread Derek Winstead
I don't have a screen shot available right now. It is a button with
left aligned text and then the count is right aligned inside the same
button. Doing the .setText() will only place the text inside the
button however the gravity is instead of the left/right aligning.

On Dec 19, 10:21 pm, TreKing treking...@gmail.com wrote:
 On Sun, Dec 19, 2010 at 8:33 PM, Derek Winstead 
 derekwinste...@gmail.comwrote:

  The buttons that say Connections and then on the right has the count
  of your connections.

 Do you have a screen shot? Because from your description, I can't imagine
 it's anything more than something like this:

 btn.setText(Connections  + numConnections);

 --- 
 --
 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] Re: Multiple TextViews Inside a Button

2010-12-19 Thread Derek Winstead
I've already done this before in my app (layout with textviews and the
layout has the onclicks), however I do have a new question. Adding the
statelist as the background works for the layout but what about the
text changing colors?

I've had a hard time figuring out how to do style changes on the fly
with android.

Thanks for all the input everyone!

On Dec 19, 11:39 pm, Sarwar Erfan erfanonl...@gmail.com wrote:
 Hi,
 You missed one element. There is two text elements and one icon also in
 right side of the number of connections (see attached image):

 https://lh4.googleusercontent.com/_Wo4N90M9Gr0/TQ7ctWlInRI/AC...

 I can confirm its not a button. Create your own layout. Use a statelist as
 background. And, use 9 patch images in the statelist (if you want it to look
 good in both orientations).

 Put two TextView and one ImageView in the layout.

 --

 State list:  
 http://developer.android.com/guide/topics/resources/drawable-resource...

 9 Patch:    
 http://developer.android.com/guide/developing/tools/draw9patch.html

 Regards
 Sarwar Erfan

  linkedin_connections_layout.png
 5KViewDownload

-- 
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 Dismiss a PopupWindow when Switching Among TabActivities?

2010-11-22 Thread Derek Brameyer
Hi,

I posted a StackOverflow question here (http://stackoverflow.com/
questions/4226898/dismiss-android-popupwindow-when-switching-to-a-new-
tab-in-tabactivity/4227034#4227034) but it didn't get any responses.

Basically, how can one dismiss a PopupWindow when changing to a
different TabActivity?  The onPause() method in my TabActivity causes
the app to force close...

Any help would be greatly appreciated!

-- 
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] Passing an ArrayList of Objects

2010-11-12 Thread Derek Winstead
Is there a way to pass an ArrayList of objects between activities? The
myObject implements Parcelable and I'm able to successfully pass the
objects around individually, but that means I need to have an exact
amount of myObjects coded. I want this to dynamically grow/shrink by
what the user does with the app.

I have seen some posts on the web about doing:

Activity A

ArrayListmyObject myObjArray = new ArrayListmyObject();

Then when passing this into the intent I would use:

intent.putParcelableArrayListExtra(myObjArray, myObjArray);

Activity B

ArrayListmyObject myObjArray = new ArrayListmyObject();

Bundle extras = getIntent().getExtras();
myObjArray = extras.getParcelableArray(myObjArray);

However, the myObjArray always gets filled with null. How can I
achieve 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] Re: Passing an ArrayList of Objects

2010-11-12 Thread Derek Winstead
Awesome! That worked. Thanks.

On Nov 12, 4:57 pm, TreKing treking...@gmail.com wrote:
 On Fri, Nov 12, 2010 at 3:15 PM, Derek Winstead 
 derekwinste...@gmail.comwrote:

  Bundle extras = getIntent().getExtras();
  myObjArray = extras.getParcelableArray(myObjArray);

 The list of items you stored in the intent is NOT placed in the extras
 Bundle - it's stored in the intent 
 itself.http://developer.android.com/reference/android/content/Intent.html#ge...

 --- 
 --
 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] Multiple Object Passing Between Activies

2010-10-14 Thread Derek Winstead
I have an application that I would like to have multiple objects
passed around the activities. It seems that when I'm passing multiple
objects using Parcelables it seems it only grabs the first object and
the rest become null. Is this a issue with android not able to handle
more than one object made parcelable or am I just doing it wrong
somehow?

-- 
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: Multiple Object Passing Between Activies

2010-10-14 Thread Derek Winstead
OK, I solved my own problem.

You can pass multiple objects using parcelable. As long as the key
names are different. In my parcelable code for the object I missed a
new variable I added in the creation of the parcelable. So when the
object is called to reconstruct itself it is going off an array that
is bigger than what I parcelabled out.

This was causing an error and making my code return a null when trying
to grab the object out of the bundle.

Thanks for the help!

On Oct 14, 3:25 pm, Kumar Bibek coomar@gmail.com wrote:
 Haven't tried this yet, never felt the need, but I am guessing that it
 should work

 On 15-Oct-2010 12:54 AM, Kostya Vasilyev kmans...@gmail.com wrote:

  14.10.2010 23:16, Derek Winstead пишет:



  I have an application that I would like to have multiple objects
  passed around the activities...

 You can attach as many Parcelable (or any other type) extras to an Intent as
 you like - just make sure that the String key is unique for each.

 Think hash tables.

 --
 Kostya Vasilyev -- WiFi Manager + pretty widget 
 --http://kmansoft.wordpress.com

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers...

-- 
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: Custom DatePickerDialog

2010-10-11 Thread Derek Winstead
I read over what you posted. Thanks for the links.

Do you have any place to look for how to setup my framework/project? I
haven't had much luck at how to setup my project in Eclipse (like how
to structure my folders and any data access objects). I wanted to have
more than one DAO class, but in doing so the first one accessed worked
but the second would not. I know its just my lack of knowledge on how
to set this up. Any help pointing me in the right direction would help
me out.

I have a working app for the most part connected to the sqlite
database but it's a huge file that has all my SQL statements and
creation of the database. I wanted to have it more pulled apart into
separate files. Comes down to it works, but not as efficiently and
visually as appealing as I would hope. I am a programmer, but in the
web world so native applications are a new beast for me and setting up
frameworks.

Thanks,
Derek

On Oct 10, 7:15 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Sun, Oct 10, 2010 at 6:45 PM, Derek Winstead

 derekwinste...@gmail.com wrote:
  I am still new to Android and Java in itself. How would I create a
  subclass of a class? Do I make a class the extends the DatePicker or
  does it implement the DatePicker? Or is it done totally different.

 You would do something like this:

 public class DerekDatePicker extends DatePicker {
    // add constructors
    // override other methods as needed to accomplish your aims

 }

 If you're new to Java, I really recommend spending some time learning
 Java outside of Android. Android is somewhat funky and, IMHO, would
 make learning Java a bit difficult, since it will not line up with
 many traditional Java books.

 FWIW, here's a blog post where I list the key topics in Java I think
 you need to know to be reasonably effective with Android:

 http://commonsware.com/blog/2010/08/02/java-good-parts-version.html

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

 _Android Programming Tutorials_ Version 3.0.1 Available!

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


[android-developers] Re: Custom DatePickerDialog

2010-10-10 Thread Derek Winstead
Thanks for the info Mark.

I am still new to Android and Java in itself. How would I create a
subclass of a class? Do I make a class the extends the DatePicker or
does it implement the DatePicker? Or is it done totally different.

Thanks,
Derek

On Oct 1, 2:27 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Wed, Sep 29, 2010 at 4:15 PM, Derek derekwinste...@gmail.com wrote:
  Is there a way to use the DatePickerDialog widget but only show/use
  the year/month and not the day? I would like to do a magazine entry
  type screen which would be a year/month setup without the day. Any
  advice would be helpful.

 Unfortunately, the dialog is not configurable. Neither is the
 underlying DatePicker widget, AFAIK. You may be able to subclass
 DatePicker and have it use a different layout, or clone the DatePicker
 source code to create your own YearAndMonthPicker. Then, you can wrap
 that in an AlertDialog.

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

 Android Training in Atlanta:http://bignerdranch.com/classes/android

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


[android-developers] Custom DatePickerDialog

2010-10-01 Thread Derek
Is there a way to use the DatePickerDialog widget but only show/use
the year/month and not the day? I would like to do a magazine entry
type screen which would be a year/month setup without the day. Any
advice would be helpful.

Thanks,
Derek

-- 
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: Device Seeding Program for Top Android Market Developers

2010-05-06 Thread Derek
still waiting in London. by the way, is it a dev phone, or a normal
one?

-- 
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] what extact tags for official releases

2010-04-26 Thread Derek
There are quite a few tags in 
http://android.git.kernel.org/?p=platform/external/opencore.git
. I'm wondering what extact tags are for the official releases Android
2.1, Revision 1, Release 1.6 r1,  Release 1.5 r3, Release 1.1 r1 and
Release 1.0 r2.

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] how add TextView/Layout to map's Overlay or OverlayItem?

2010-04-12 Thread Derek
When a marker is clicked on google map, a small square area is
displayed with hyperlinks. I guess OverlayItem does not render
hyperlinks for its snippet. How to achieve this? Ideally I want to
assign a layout with all sorts widgets. Presume I can display a small
floating activity window when the marker is clicked, but is this the
standard way doing this? The drawback of floating activity window is
that if want to click another marker, user has to dismiss the current
window first.

Thanks,
Derek

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Intent to upload or download files over SFTP, FTPS or FTP

2010-04-05 Thread Derek
Hi,

AndFTP provides intents for third party applications to transfer files/
folders to any FTP, SFTP or FTPS server from sdcard. Here is a sample
for upload:

Intent intent = new Intent();
intent.setAction(Intent.ACTION_PICK);
// FTP URL (Starts with ftp://, sftp:// or ftps:// followed by
hostname and port).
Uri ftpUri = Uri.parse(ftp://yourftpserver.com:21;);
intent.setDataAndType(ftpUri, vnd.android.cursor.dir/
lysesoft.andftp.uri);
// FTP credentials (optional)
intent.putExtra(ftp_username, anonymous);
intent.putExtra(ftp_password, someth...@somewhere.com);
//intent.putExtra(ftp_keyfile, /sdcard/dsakey.txt);
//intent.putExtra(ftp_keypass, optionalkeypassword);
// FTP settings (optional)
intent.putExtra(ftp_pasv, true);
//intent.putExtra(ftp_resume, true);
//intent.putExtra(ftp_encoding, UTF8);
// Upload
intent.putExtra(command_type, upload);
// Activity title
intent.putExtra(progress_title, Uploading files ...);
intent.putExtra(local_file1, /sdcard/subfolder1/file1.zip);
intent.putExtra(local_file2, /sdcard/subfolder2/file2.zip);
// Optional initial remote folder (it must exist before upload)
intent.putExtra(remote_folder, remotefolder/subfolder);
startActivityForResult(intent, 1);

More samples at:
http://www.lysesoft.com/support/forums/viewtopic.php?f=5t=157
http://www.lysesoft.com/support/forums/viewtopic.php?f=5t=158

Hope it helps.

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: AlarmManager on droids

2010-03-22 Thread Derek
Mark,

It doesn't seem to consume battery. I've tried several solutions and
only yours is really working.
Before I used a regular service with a AlarmManager.set(...) to
schedule service run every minute.
It worked fine on emulator (even when killing the service) but on real
devices it failed often.
I mean sometimes the Alarm did no go off after a few hours. That's why
I tried your solution based on AlarmManager.setRepeating(...).

What do you think about it ?

On Mar 21, 9:28 pm, Mark Murphy mmur...@commonsware.com wrote:
 Derek wrote:
  Refresh is every minute.

 :: blink, blink ::

 Every *minute*?

 That's not really a good idea.

 If you have a short-term need for an every-minute bit of work, you may
 as well use a regular Service and a Timer/TimerTask. This would, by
 definition, eliminate your classloading problem, because you wouldn't be
 starting and stopping the service.

 If you have a long-term need for an every-minute bit of work, you might
 want to switch to developing for things that don't run on really small
 batteries and have very little RAM. :-)

 While my WakefulIntentService sample uses a five-minute period, even
 that's kinda frequent -- I only use that to limit frustration for people
 testing the code.

  Here is the WakefulIntentService I'm using:

 That resembles one I wrote. Releasing the lock in finally {} is a good
 move -- I need to fix mine for that.

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

 Android 2.0 Programming Books:http://commonsware.com/books

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


[android-developers] Re: AlarmManager on droids

2010-03-21 Thread Derek
Refresh is every minute. We didn't get crash report from 2.x users
yet.
Here is the WakefulIntentService I'm using:

public abstract class WakefulIntentService extends IntentService
{
public static final String LOCK_NAME_STATIC =
my.app.Service.Static;
private static PowerManager.WakeLock lockStatic = null;
private static final String TAG =
WakefulIntentService.class.getName();

public WakefulIntentService(String name)
{
super(name);
}

public static void acquireStaticLock(Context context)
{
try
{
getLock(context).acquire();
LogHelper.i(TAG, Wake lock acquired);
}
catch (Throwable e)
{
LogHelper.e(TAG, Cannot acquire wake lock, e);
}
}

synchronized private static PowerManager.WakeLock getLock(Context
context)
{
if (lockStatic == null)
{
PowerManager mgr =
(PowerManager)context.getSystemService(Context.POWER_SERVICE);
lockStatic = 
mgr.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
LOCK_NAME_STATIC);
lockStatic.setReferenceCounted(true);
}
return(lockStatic);
}


/* (non-Javadoc)
 * @see
android.app.IntentService#onHandleIntent(android.content.Intent)
 */
protected void onHandleIntent(Intent intent)
{
CrashReportHandler.getInstance().init(this);
LogHelper.i(TAG, Service onHandleIntent started ( + this + )
(+Thread.currentThread()+) ( + intent + ));
try
{
processWakefulWork(intent);
}
catch (Throwable e)
{
LogHelper.e(TAG, Service Cannot perform 
onHandleIntent, e);
}
finally
{
try
{
if (getLock(this).isHeld())
{
getLock(this).release();
LogHelper.i(TAG, Wake lock released);
}
}
catch (Throwable e)
{
LogHelper.e(TAG, Cannot release wake lock, e);
}
LogHelper.i(TAG, Service onHandleIntent completed ( + 
this + )
(+Thread.currentThread()+) );
}
}

public abstract void processWakefulWork(Intent intent);
}


On Mar 20, 12:56 pm, Mark Murphy mmur...@commonsware.com wrote:
 Derek wrote:
  I've implemented it and I got the crash report from the end user. See
  details below.
  The error report is VerifyError when the broadcastReceiver tries to
  start the WakefulIntentService.
  It happens on Cupcake/Samsumg. I've tested under emulator with 1.5
  (minSDK=3) and it works perfect.
  It seems that a WakefulIntentService field or class is not valid. What
  could be the problem ?
  The service was working before without extending WakefulIntentService
  under the same device.

 Well, WakefulIntentService has a static data member for a WakeLock, but
 that's about it.

 First, make sure you're using a fairly recent version of
 WakefulIntentService -- if you had to override doWakefulWork(), that's
 recent enough.

 Also, what period are you using for the AlarmManager? I can try to
 reproduce the problem on other 1.5 equipment I have here in my Secret
 Mountain Lair.

 Also also, your earlier post mentioned you were also getting it on 2.1.
 Let me know if you get a crash report for it.

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

 Android Training...At Your Office:http://commonsware.com/training

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


[android-developers] Re: AlarmManager on droids

2010-03-20 Thread Derek
Hi Mark,

I've implemented it and I got the crash report from the end user. See
details below.
The error report is VerifyError when the broadcastReceiver tries to
start the WakefulIntentService.
It happens on Cupcake/Samsumg. I've tested under emulator with 1.5
(minSDK=3) and it works perfect.
It seems that a WakefulIntentService field or class is not valid. What
could be the problem ?
The service was working before without extending WakefulIntentService
under the same device.

Device:
==
Package: my.application
Phone model: SPH-M900
Android Version: 1.5
Board: SPH-M900
Brand: Samsung
Device: SPH-M900
Display: CUPCAKE.CJ05
FingerPrint: Samsung/SPH-M900/SPH-M900/SPH-M900:1.5/CUPCAKE/CJ05:user/
ota-rel-keys,release-keys
ID: CUPCAKE
Model: SPH-M900
Product: Samsung
Total internal memory : 292724736
Available internal memory : 172212224

Stack:
=
java.lang.VerifyError:
my.application.widget.UpdateServiceExtendingWakefulIntentService
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1472)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:
2446)
at android.app.ActivityThread.access$2800(ActivityThread.java:112)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
1744)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3948)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:782)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
at dalvik.system.NativeStart.main(Native Method)

Thread:
==
Thread[main,5,main]

Any idea ?

Thanks.

On Mar 19, 5:52 pm, Mark Murphy mmur...@commonsware.com wrote:
 Derek wrote:
  I'm also using your WakefulIntentService sample. It works fine in
  emulator (all releases of Android). It seems to work fine on many
  devices (HTC Magic, Nexus One ...). However, I get Force Close
  complains from some users everytime the Alarm goes off. Some are under
  1.5 and other are under 2.1. Did you experiment such issue ? I don't
  understand how it can generate a Force Close because I've used a try
  {} catch (Throwable) in the handleIntent method.

  Users are not able to tell me more about the issue. All they can say
  is that the phone displays Force Close dialog evertime the Alarm
  goes off. Using single Alarm (and set it after service run) instead
  of repeating Alarm seems to fix the issue for these users.

  Thanks for any help or advice.

 Use Flurry, DroidDrop, or similar tools to register a top-level
 exception handler via Thread.setDefaultUncaughtExceptionHandler(). You
 should be able to collect more information about what is going wrong.

 http://www.androidguys.com/2009/11/16/diagnosing-sporadic-errors/

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

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

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


[android-developers] Re: AlarmManager on droids

2010-03-19 Thread Derek
Hi Mark,

I'm also using your WakefulIntentService sample. It works fine in
emulator (all releases of Android). It seems to work fine on many
devices (HTC Magic, Nexus One ...). However, I get Force Close
complains from some users everytime the Alarm goes off. Some are under
1.5 and other are under 2.1. Did you experiment such issue ? I don't
understand how it can generate a Force Close because I've used a try
{} catch (Throwable) in the handleIntent method.

Users are not able to tell me more about the issue. All they can say
is that the phone displays Force Close dialog evertime the Alarm
goes off. Using single Alarm (and set it after service run) instead
of repeating Alarm seems to fix the issue for these users.

Thanks for any help or advice.

Derek.

On Mar 13, 4:16 pm, Mark Murphy mmur...@commonsware.com wrote:
 mot12 wrote:
  No customer could give me a definitive guide to reproduce the problem.
  But doing the following should give you good chance to make it happen
  on your device:
  - turn on airplane mode to cancel much of the background activity
  - turn off any services, apps running in the background
  - let the device sit with the screen off for several hours (no alarms
  during this time)

 You do realize that this isn't possible. The operating system has
 services. Built-in Android apps have services.

 Besides, what's the point of a phone that is permanently in airplane mode?

 I don't have a problem with doing bits of research here and there, but
 this has spiraled into it's never going to affect enough people status.

 If you come up with probable steps to reproduce the issue that would
 suggest that the problem might affect a substantial number of users,
 drop me a line.

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

 Android Training in NYC: 10-11 April 2010:http://guruloft.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-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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


[android-developers] Re: Crashed Service not restarting - Dianne could you help (again) ?

2010-02-16 Thread Derek
Anyone ?

Thanks.

On Feb 12, 7:35 pm, Derek cram.de...@gmail.com wrote:
 Hi again,

 I've new logs from the Android device (see below). Our application
 generates more logs now (stopping , onDestroy, onStart, onCreate ...)
 Could you advise ? We don't know the way to troubleshoot this issue.
 Everything works fine in emulator even when we kill (or crash) the
 service while running. It stops randomly on real devices (whatever
 Android version).
 Where to start to get a clue ?

 ...
 02-12 18:26:01.173: INFO/xx.yy.zz.RefreshService(1676): RefreshService
 stopping (xx.yy.zz.refreshserv...@43239188)
 02-12 18:26:01.173: INFO/ActivityManager(74): Stopping service:
 xx.yy/.widget.RefreshService
 02-12 18:26:01.173: INFO/xx.yy.zz.RefreshService(1676): RefreshService
 onDestroy (xx.yy.zz.refreshserv...@43239188)

 EVERYTHING IS FINE UNTIL HERE.

 02-12 18:26:06.293: DEBUG/dalvikvm(1676): GC freed 3224 objects /
 186016 bytes in 107ms
 02-12 18:26:28.973: DEBUG/Sensors(74): sensors=, real=
 02-12 18:26:29.063: DEBUG/AKMD(56): Compass CLOSE
 02-12 18:26:29.273: DEBUG/dalvikvm(74): GC freed 5551 objects / 238016
 bytes in 260ms
 02-12 18:26:29.313: DEBUG/SurfaceFlinger(74): About to give-up screen,
 flinger = 0x189700
 02-12 18:27:10.535: WARN/ActivityManager(74): Scheduling restart of
 crashed service xx.yy/.widget.RefreshService in 5000ms
 02-12 18:27:10.545: DEBUG/KeyguardViewMediator(74):
 wakeWhenReadyLocked(82)
 02-12 18:27:10.545: DEBUG/KeyguardViewMediator(74):
 handleWakeWhenReady(82)
 02-12 18:27:10.545: DEBUG/KeyguardViewMediator(74): pokeWakelock(5000)
 02-12 18:27:10.565: DEBUG/Sensors(74): sensors=0001, real=0001
 02-12 18:27:10.565: DEBUG/AKMD(56): Compass OPEN
 02-12 18:27:10.625: WARN/ActivityManager(74): Exception when starting
 service xx.yy/.widget.RefreshService
 02-12 18:27:10.625: WARN/ActivityManager(74):
 android.os.DeadObjectException
 02-12 18:27:10.625: WARN/ActivityManager(74):     at
 android.os.BinderProxy.transact(Native Method)
 02-12 18:27:10.625: WARN/ActivityManager(74):     at
 android.app.ApplicationThreadProxy.scheduleCreateService(ApplicationThreadNative.java:
 545)
 02-12 18:27:10.625: WARN/ActivityManager(74):     at
 com.android.server.am.ActivityManagerService.realStartServiceLocked(ActivityManagerService.java:
 9938)
 02-12 18:27:10.625: WARN/ActivityManager(74):     at
 com.android.server.am.ActivityManagerService.bringUpServiceLocked(ActivityManagerService.java:
 10054)
 02-12 18:27:10.625: WARN/ActivityManager(74):     at
 com.android.server.am.ActivityManagerService.startServiceLocked(ActivityManagerService.java:
 10235)
 02-12 18:27:10.625: WARN/ActivityManager(74):     at
 com.android.server.am.ActivityManagerService.startServiceInPackage(ActivityManagerService.java:
 10264)
 02-12 18:27:10.625: WARN/ActivityManager(74):     at
 com.android.server.am.PendingIntentRecord.send(PendingIntentRecord.java:
 227)
 02-12 18:27:10.625: WARN/ActivityManager(74):     at
 android.app.PendingIntent.send(PendingIntent.java:400)
 02-12 18:27:10.625: WARN/ActivityManager(74):     at
 com.android.server.AlarmManagerService
 $AlarmThread.run(AlarmManagerService.java:636)
 02-12 18:27:10.655: INFO/ActivityManager(74): Start proc xx.yy for
 service xx.yy/.widget.RefreshService: pid=1687 uid=10025 gids={3003,
 1015}
 02-12 18:27:10.705: INFO/ActivityManager(74): Process xx.yy(pid 1676)
 has died.
 02-12 18:27:10.805: DEBUG/SurfaceFlinger(74): Screen about to return,
 flinger = 0x189700
 02-12 18:27:10.875: INFO/WindowManager(74): onOrientationChanged,
 rotation changed to 0
 02-12 18:27:10.935: INFO/dalvikvm(1687): Debugger thread not active,
 ignoring DDM send (t=0x41504e4d l=38)
 02-12 18:27:10.955: WARN/ActivityManager(74): No pending application
 record for pid 1687 (IApplicationThread
 android.app.applicationthreadpr...@434eae58); dropping process

 WE DON'T UNDERSTAND THE BEHAVIOR ABOVE.

 02-12 18:27:10.955: INFO/Process(74): Sending signal. PID: 1687 SIG: 9
 02-12 18:27:10.985: INFO/Bluetooth AT sent(115): +CIEV: 5,4
 02-12 18:27:15.805: DEBUG/Sensors(74): sensors=, real=
 02-12 18:27:15.955: DEBUG/AKMD(56): Compass CLOSE
 02-12 18:27:16.155: DEBUG/SurfaceFlinger(74): About to give-up screen,
 flinger = 0x189700
 02-12 18:31:33.800: DEBUG/NetworkLocationProvider(74):
 onDataConnectionStateChanged 1
 ...

 DUMP OF SERVICE activity.services:
 Services in Current Activity Manager State:

   Active services:
   * ServiceRecord{4360d070 xx.yy/.widget.RefreshService}
     intent={cmp=xx.yy/.widget.RefreshService}
     packageName=xx.yy
     processName=xx.yy
     baseDir=/data/app/xx.yy.apk/data/app/xx.yy.apk dataDir=/data/data/
 xx.yy
     app=ProcessRecord{434e9810 0:xx.yy/10025}
     isForeground=false lastActivity=-241595
     startRequested=true startId=1 executeNesting=2
 executingStart=-236564 crashCount=0
     totalRestartCount=1 restartCount=1 restartDelay=5000
 restartTime=-241595 nextRestartTime=-236564
 ...

   Pending services

[android-developers] Re: Crashed Service not restarting - Dianne could you help (again) ?

2010-02-12 Thread Derek
/xx.yy.apk/data/app/xx.yy.apk dataDir=/data/data/
xx.yy
app=ProcessRecord{434e9810 0:xx.yy/10025}
isForeground=false lastActivity=-241694
startRequested=true startId=1 executeNesting=2
executingStart=-236663 crashCount=0
totalRestartCount=1 restartCount=1 restartDelay=5000
restartTime=-241694 nextRestartTime=-236663
...

  Restarting services:
  * Restarting ServiceRecord{4360d070 xx.yy/.widget.RefreshService}
intent={cmp=xx.yy/.widget.RefreshService}
packageName=xx.yy
processName=xx.yy
baseDir=/data/app/xx.yy.apk/data/app/xx.yy.apk dataDir=/data/data/
xx.yy
app=ProcessRecord{434e9810 0:xx.yy/10025}
isForeground=false lastActivity=-241734
startRequested=true startId=1 executeNesting=2
executingStart=-236703 crashCount=0
totalRestartCount=1 restartCount=1 restartDelay=5000
restartTime=-241734 nextRestartTime=-236703

Thanks again for any help you could provide.

Cheers.

On Jan 7, 1:29 am, Dianne Hackborn hack...@android.com wrote:
 You probably want to fix the cause of your service crashing, so...  what is
 the actual stack crawl of the exception?  You don't show that anywhere.

 On Wed, Jan 6, 2010 at 2:03 PM, Derek cram.de...@gmail.com wrote:
  Hi again,

  Our service is still crashing for some reason not related to our
  application. To make sure it's not RunTime exception we've used a :
  try
  {
   // Get WakeLock
   // Perform actions
  }
  catch (Throwable t)
  {
   // log error (if any)
  }
  finally
  {
   // Schedule a new service startup and PendingIntent an AlarmManager
   long tick = 6L;
   long nextUpdate = System.currentTimeMillis();
   nextUpdate += (tick - nextUpdate % tick);
   Intent updateIntent = new Intent();
   updateIntent.setClass(this, RefreshService.class);
   PendingIntent pendingIntent = PendingIntent.getService(this, 0,
  updateIntent, 0);
   AlarmManager alarmManager = (AlarmManager)getSystemService
  (Context.ALARM_SERVICE);
   alarmManager.set(AlarmManager.RTC, nextUpdate, pendingIntent);
   // Release WakeLock
   ...
  }
  stopSelf();

  The service is still crashing randomly on real device (Android 1.6/HTC
  Magic) and it does not restart. It's not a problem of Taskiller
  because it is not installed.
  Here are the logs:
  01-06 21:18:00.653: INFO/ActivityManager(75): Stopping service:
  xx.yy/.widget.RefreshService
  01-06 21:18:06.283: DEBUG/dalvikvm(1318): GC freed 4957 objects /
  283104 bytes in 110ms
  // Problem starts here.
  01-06 21:18:59.153: INFO/ActivityManager(75): Process xx.yy(pid 1318)
  has died.
  01-06 21:21:33.530: INFO/ActivityManager(75): Start proc xx.yyfor
  service xx.yy/.widget.RefreshService: pid=1339 uid=10031 gids={3003,
  1015}
  01-06 21:21:33.720: INFO/dalvikvm(1339): Debugger thread not active,
  ignoring DDM send (t=0x41504e4d l=38)
  01-06 21:21:33.750: INFO/dalvikvm(1339): Debugger thread not active,
  ignoring DDM send (t=0x41504e4d l=48)
  01-06 21:21:34.520: INFO/ActivityManager(75): Stopping service:
  xx.yy/.widget.RefreshService
  01-06 21:23:11.526: ERROR/JavaBinder(75): !!! FAILED BINDER
  TRANSACTION !!!
  01-06 21:23:11.536: ERROR/JavaBinder(75): !!! FAILED BINDER
  TRANSACTION !!!
  01-06 21:23:11.635: INFO/ActivityManager(75): Process xx.yy(pid 1339)
  has died.
  01-06 21:23:11.686: WARN/ActivityManager(75): Scheduling restart of
  crashed service xx.yy/.widget.RefreshService in 5000ms
  01-06 21:23:16.736: INFO/ActivityManager(75): Start proc xx.yy for
  service xx.yy/.widget.RefreshService: pid=1349 uid=10031 gids={3003,
  1015}
  01-06 21:23:16.825: INFO/dalvikvm(1349): Debugger thread not active,
  ignoring DDM send (t=0x41504e4d l=38)
  01-06 21:23:16.855: INFO/dalvikvm(1349): Debugger thread not active,
  ignoring DDM send (t=0x41504e4d l=48)
  // But service never restarts !

  We've run the following command according to Dianne advice: adb shell
  dumpsys activity.services and we can see our service but it is not
  executed.

  Currently running services:
   activity.services

  ---
  DUMP OF SERVICE activity.services:
  Services in Current Activity Manager State:
   Active services:
   * ServiceRecord{43563d78 xx.yy/.widget.RefreshService}
     intent={cmp=xx.yy/.widget.RefreshService}
     packageName=xx.yy
     processName=xx.uu
     baseDir=/data/app/xx.yy.apk/data/app/xx.yy.apk dataDir=/data/data/
  xx.yy
     app=ProcessRecord{4348d8f8 1349:xx.yy/10031}
     isForeground=false lastActivity=-675021
     startRequested=true startId=1 executeNesting=0
  executingStart=-675021 crashCount=0
     totalRestartCount=1 restartCount=1 restartDelay=5000
  restartTime=-675021 nextRestartTime=-675183

   * ServiceRecord{43471978
  com.google.android.location/.NetworkLocationService}
     intent={cmp=com.google.android.location/.NetworkLocationService}
     packageName=com.google.android.location
     processName=system
     baseDir=/system/app/NetworkLocation.apk/system/app/
  NetworkLocation.apk

[android-developers] Different class files are generated using Eclipse Ant

2010-02-09 Thread Derek Lee
Hi,

I'm using Eclipse GALILEO, android 1.6, and Ant 1.8.0RC1 version.

After building with Eclipse and Ant, I compared each
generated .class, .dex, .apk files.
But,each files are not same...

For example,
There is MethodList.class file(built with Eclipse) in bin folder,
and MethodList.class file(built with ant) in bin_1.6 folder,

bin/MethodList.class , bin_1.6/MethodList.class are not same...

So, my questions are :
1. If each binary files(.class, .dex, .apk files) are not same, they
can do same thing in each emulator or device?
2. (if not) How can i build same binaries using Eclipse  Ant?


My Eclipse build options(Preferences - Java - Compiler) are like
these:
- Complier compliance lever : 1.6
- Use default compliance settings : checked
- Generated .class files compatibility : 1.6
- Source compatibility : 1.6
- Disallow idenfitiers called 'assert' : Error
- Disallow identifiers called 'enum' : Error
- Add variable attributes to generate class files : checked
- Add line number attributes to generate class files : checked
- Add Source file name to generate class file : checked
- preserve unused(never read) local vairables : checked
- inline finally blocks : checked

And my Javac, dex, apk builder option is Build.xml are like these :
!-- Compile this project's .java files into .class files. --
target name=compile depends=resource-src, aidl
javac encoding=ascii target=1.5 debug=true extdirs=
destdir=${out-classes}
bootclasspathref=android.target.classpath
src path=${source-folder} /
src path=${gen-folder} /
classpath
fileset dir=${external-libs-folder}
includes=*.jar/
pathelement path=${main-out-classes}/
/classpath
 /javac
/target

 !-- Convert this project's .class files into .dex files. --
target name=dex depends=compile
echoConverting compiled files and external libraries into $
{out-folder}/${dex-file}.../echo
apply executable=${dx} failonerror=true parallel=true
arg value=--dex /
arg value=--output=${intermediate-dex-location} /
arg path=${out-classes-location} /
fileset dir=${external-libs-folder} includes=*.jar/
/apply
/target

target name=package
apkbuilder
outfolder=${out-folder}
basename=${ant.project.name}
signed=${sign.package}
verbose=true
file path=${intermediate-dex} /
sourcefolder path=${source-folder} /
jarfolder path=${external-libs-folder} /
nativefolder path=${native-libs-folder} /
/apkbuilder
/target

-- 
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: Crashed Service not restarting - !!! FAILED BINDER TRANSACTION !!! - Dianne could you help ?

2010-01-06 Thread Derek
/.LatinIME:@43338040}
binding=AppBindRecord{4329e058
com.android.inputmethod.latin/.LatinIME:system}
conn=android.app.ActivityThread$PackageInfo$ServiceDispatcher
$innerconnect...@43338040 flags=0x1

  * ConnectionRecord{433e7338
com.google.android.googleapps/.GoogleLoginService:@433e2100}
binding=AppBindRecord{43430918
com.google.android.googleapps/.GoogleLoginService:com.google.process.gapps}
conn=android.os.binderpr...@433e2100 flags=0x1

  * ConnectionRecord{433b9908
com.google.android.googleapps/.GoogleLoginService:@433b9878}
binding=AppBindRecord{43430918
com.google.android.googleapps/.GoogleLoginService:com.google.process.gapps}
conn=android.os.binderpr...@433b9878 flags=0x1

  * ConnectionRecord{43398190
com.google.android.googleapps/.GoogleLoginService:@433a3768}
binding=AppBindRecord{43430918
com.google.android.googleapps/.GoogleLoginService:com.google.process.gapps}
conn=android.os.binderpr...@433a3768 flags=0x1

If we run the same command 2 hours later it returns for our service:

DUMP OF SERVICE activity.services:
Services in Current Activity Manager State:
  Active services:
  * ServiceRecord{43563d78 xx.worldwidyyetime/.widget.RefreshService}
intent={cmp=xx.yy/.widget.RefreshService}
packageName=xx.yy
processName=xx.yy
baseDir=/data/app/xx.yy.apk/data/app/xx.yy.apk dataDir=/data/data/
xx.yy
app=ProcessRecord{4348d8f8 1349:xx.yy/10031}
isForeground=false lastActivity=-5474190
startRequested=true startId=1 executeNesting=0
executingStart=-5474190 crashCount=0
totalRestartCount=1 restartCount=1 restartDelay=5000
restartTime=-5474190 nextRestartTime=-5474352

What could be the problem ?

Thanks for you help.

On Dec 31 2009, 11:25 am, Derek cram.de...@gmail.com wrote:
 I can confirm that the problem does not come from TasKiller. I've
 uninstalled it and the problem is still here.
 I'm not able to reproduce it on emulator and it happens on real device
 no more than once a week so it's really difficult to reproduce.

 Any hint is welcome.

 Cheers.

 On Nov 27, 7:50 pm, Dianne Hackborn hack...@android.com wrote:

  Fyi, you can use adb shell dumpsys activity.services to see the state of
  all active services, including those that are started but not currently
  running and waiting for a restart.

  On Fri, Nov 27, 2009 at 10:44 AM, Derek cram.de...@gmail.com wrote:
   Hi Nicolas,

   Thanks for the feedback. I've double checked the logs and I don't see
   anything about TasKiller when the process has died.
   In the meantime I've read the following thread about developers
   complaining about Task killers applications (not yours especially).

  http://groups.google.com/group/android-developers/browse_thread/threa...
   (Our users complain that widget updates stop too)

   So, I've uninstalled TaskKiller, run GoogleMaps to generate a process
   kill from Android. Here are the logs just after GoogleMaps starting:
   [...]
   11-27 19:25:47.494: INFO/ActivityManager(74): Process abc (pid 3509)
   has died.
   [...]
   11-27 19:26:00.044: INFO/ActivityManager(74): Start proc abc for
   service abc/.xyz.RefreshService: pid=3603 uid=10033 gids={3003, 1015}
   [...]
   11-27 19:26:00.424: INFO/abc.xyz.RefreshService(3603): RefreshService
   started (abc.xyz.refreshserv...@431f1d38)
   [...]
   It seems to work now. The only difference is that the following trace
   does not appear:
   Scheduling restart of crashed service abc/.xyz.RefreshService in
   5000ms.

   Could it be a bug in your application ? or in the Android API you're
   using to monitor running processes ?
   It may prevent a service from restart. Is there any test I can do to
   make sure ?

   Thanks again.

   On Nov 27, 7:25 pm, Nicolas Thibaut nthibau...@gmail.com wrote:
Hi, Taskiller use ActivityManager to kill process (there is no kill
but uninstall process).

If I kill taskiller itselfs, the log are:

11-27 19:16:58.952 I/ActivityManager(   75): Displayed activity
com.tni.TasKiller/.TasKiller: 2023 ms (total 2023 ms)
11-27 19:16:59.032 I/ActivityManager(   75): Process
com.android.settings (pid 4361) has died.
11-27 19:17:05.212 D/dalvikvm( 2816): GC freed 2448 objects / 115688
bytes in 175ms
11-27 19:17:12.842 D/ActivityManager(   75): Uninstalling process
com.tni.TasKiller
11-27 19:17:12.842 D/ActivityManager(   75): Force removing process
ProcessRecord{43678608 4341:com.tni.TasKiller/10030}
(com.tni.TasKiller/10030)

If your service die without this log, Taskiller is not guilty !
And if your service is killed by taskiller : the user HOPE it will
NEVER restart.

On Nov 27, 7:01 pm, Derek cram.de...@gmail.com wrote:

 Hi Diane,

 We've have exactly the same problem. We have TasKiller v2.2 installed
 but we DO NOT use it to kill our app.
 However, our service (running every one minute thanks to AlarmManager)
 never restarts after process has died.
 Here are the log extracted

[android-developers] Re: File creation problem in Android source build

2010-01-05 Thread Derek
does the below permission help?
android.permission.WRITE_EXTERNAL_STORAGE

On Jan 5, 9:54 am, Arun achoudhary2...@gmail.com wrote:
 Hi ,

 I am trying to create a file in android framework using the following
 snippet of code :-

 public void CreateMyFile()
     {
 try {
 String destination = /data/hellothere.txt;

 File fileCon= new File(destination);
 if( ! fileCon.exists() ){
         fileCon.createNewFile();
     }}

 catch (IOException ioe) {
 ioe.printStackTrace();}

   //FilePermission fp=new FilePermission(destination,write);
     }

 When i compile this on sdk and execute it, everythng works fine and
 file got created in the /data path with the hellothere.txt name.
 But when i compile it in the source code and execute this on a android
 filesystem on emulator and real hardware, the file is not getting
 created and I am getting teh following error in logcat :-

 I/ActivityManager(   54): Start proc file.app for activity
 file.app/.fileop: pid=632 uid=10043 gids={1015}
 W/System.err(  632): java.io.IOException: Parent directory of file is
 not writable: /data/hellothere.txt
 W/System.err(  632): at java.io.File.createNewFile(File.java:1263)
 W/System.err(  632): at file.app.fileop.onCreate(fileop.java:44)
 W/System.err(  632): at
 android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
 1047)
 W/System.err(  632): at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2431)
 W/System.err(  632): at android.app.ActivityThread.handleLaunchActivity
 (ActivityThread.java:2484)
 W/System.err(  632): at android.app.ActivityThread.access$2200
 (ActivityThread.java:119)
 W/System.err(  632): at android.app.ActivityThread$H.handleMessage
 (ActivityThread.java:1835)
 W/System.err(  632): at android.os.Handler.dispatchMessage
 (Handler.java:99)
 W/System.err(  632): at android.os.Looper.loop(Looper.java:123)
 W/System.err(  632): at android.app.ActivityThread.main
 (ActivityThread.java:4325)
 W/System.err(  632): at java.lang.reflect.Method.invokeNative(Native
 Method)
 W/System.err(  632): at java.lang.reflect.Method.invoke(Method.java:
 521)
 W/System.err(  632): at com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:860)
 W/System.err(  632): at com.android.internal.os.ZygoteInit.main
 (ZygoteInit.java:618)
 W/System.err(  632): at dalvik.system.NativeStart.main(Native Method)
 I/ActivityManager(   54): Displayed activity file.app/.fileop: 5196 ms
 (total 5196 ms)

 Please someone help me in this regard

-- 
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: Crashed Service not restarting - TasKiller or Android issue ?

2009-12-31 Thread Derek
I can confirm that the problem does not come from TasKiller. I've
uninstalled it and the problem is still here.
I'm not able to reproduce it on emulator and it happens on real device
no more than once a week so it's really difficult to reproduce.

Any hint is welcome.

Cheers.

On Nov 27, 7:50 pm, Dianne Hackborn hack...@android.com wrote:
 Fyi, you can use adb shell dumpsys activity.services to see the state of
 all active services, including those that are started but not currently
 running and waiting for a restart.



 On Fri, Nov 27, 2009 at 10:44 AM, Derek cram.de...@gmail.com wrote:
  Hi Nicolas,

  Thanks for the feedback. I've double checked the logs and I don't see
  anything about TasKiller when the process has died.
  In the meantime I've read the following thread about developers
  complaining about Task killers applications (not yours especially).

 http://groups.google.com/group/android-developers/browse_thread/threa...
  (Our users complain that widget updates stop too)

  So, I've uninstalled TaskKiller, run GoogleMaps to generate a process
  kill from Android. Here are the logs just after GoogleMaps starting:
  [...]
  11-27 19:25:47.494: INFO/ActivityManager(74): Process abc (pid 3509)
  has died.
  [...]
  11-27 19:26:00.044: INFO/ActivityManager(74): Start proc abc for
  service abc/.xyz.RefreshService: pid=3603 uid=10033 gids={3003, 1015}
  [...]
  11-27 19:26:00.424: INFO/abc.xyz.RefreshService(3603): RefreshService
  started (abc.xyz.refreshserv...@431f1d38)
  [...]
  It seems to work now. The only difference is that the following trace
  does not appear:
  Scheduling restart of crashed service abc/.xyz.RefreshService in
  5000ms.

  Could it be a bug in your application ? or in the Android API you're
  using to monitor running processes ?
  It may prevent a service from restart. Is there any test I can do to
  make sure ?

  Thanks again.

  On Nov 27, 7:25 pm, Nicolas Thibaut nthibau...@gmail.com wrote:
   Hi, Taskiller use ActivityManager to kill process (there is no kill
   but uninstall process).

   If I kill taskiller itselfs, the log are:

   11-27 19:16:58.952 I/ActivityManager(   75): Displayed activity
   com.tni.TasKiller/.TasKiller: 2023 ms (total 2023 ms)
   11-27 19:16:59.032 I/ActivityManager(   75): Process
   com.android.settings (pid 4361) has died.
   11-27 19:17:05.212 D/dalvikvm( 2816): GC freed 2448 objects / 115688
   bytes in 175ms
   11-27 19:17:12.842 D/ActivityManager(   75): Uninstalling process
   com.tni.TasKiller
   11-27 19:17:12.842 D/ActivityManager(   75): Force removing process
   ProcessRecord{43678608 4341:com.tni.TasKiller/10030}
   (com.tni.TasKiller/10030)

   If your service die without this log, Taskiller is not guilty !
   And if your service is killed by taskiller : the user HOPE it will
   NEVER restart.

   On Nov 27, 7:01 pm, Derek cram.de...@gmail.com wrote:

Hi Diane,

We've have exactly the same problem. We have TasKiller v2.2 installed
but we DO NOT use it to kill our app.
However, our service (running every one minute thanks to AlarmManager)
never restarts after process has died.
Here are the log extracted today on my HTC device under 1.6:
[...]
11-27 18:14:00.463: INFO/abc.RefreshService(1482): Alarm planned in
6 milliseconds at 125934210 (abc.refreshserv...@431e8178 -
PendingIntent{431f71f8: android.os.binderpr...@431f71b0})
11-27 18:14:00.463: INFO/abc.RefreshService(1482): RefreshService
stopping (abc.refreshserv...@431e8178)
11-27 18:14:00.463: INFO/ActivityManager(74): Stopping service:
abc/.xyz.RefreshService
[...]
11-27 18:15:07.629: INFO/ActivityManager(74): Process abc (pid 1482)
has died.
11-27 18:15:07.679: WARN/ActivityManager(74): Scheduling restart of
crashed service abc/.xyz.RefreshService in 5000ms
[...]
11-27 18:19:26.131: INFO/ActivityManager(74): Start proc abc for
service abc/.xyz.RefreshService: pid=1536 uid=10033 gids={3003, 1015}
11-27 18:19:26.241: INFO/dalvikvm(1536): Debugger thread not active,
ignoring DDM send (t=0x41504e4d l=38)
[...]

Do you mean that the problem could come from TaskKiller application ?
Once problem has occurred I still can see our app in TasKiller as
Italic/grayed (which means that a service is running in background) or
yellow.

Thanks.

On Nov 22, 8:53 pm, Dianne Hackborn hack...@android.com wrote:

 That's what the task killers do.  Don't use them if you don't want
  this to
 happen.  You can't get around this.  The API they are using is
  intended for
 the user to explicitly stop everything about an app.

 On Sat, Nov 21, 2009 at 6:53 PM, shahzad ahmad 
  shahzad.s.ah...@gmail.comwrote:

  Hi,
      I'm just investing how crashed services are restarted. I've
  developed a
  simple service and use a taskkiller from market place to kill the
  application. Following are the logs after application is killed

[android-developers] How to simulate service crash in emulator ?

2009-12-31 Thread Derek
Hi all,

Does someone know how to simulate service crash in emulator ?

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: } catch (OutOfMemoryError E) {

2009-12-12 Thread Derek
I think I'm a little confused about how bitmap scaling is working with
Android 2.0.  We have an activity with a ListView which displays a
small image (let's say 65x90sp) in each list item.  The image source
is just an image from the camera but we have specified that 65x90sp
size for the ImageView and specified it to scale using fitXY.  This
code works on all current phones except the Droid.  We've tested with
over 20 items in the list and no memory issues occur whatsoever on any
phones except the Droid where it fails as soon as there are more than
1 entry in the list (OutOfMemoryException).

I assumed that when you specified fitXY in the layout, that under the
covers the bitmap was being scaled to that size before display and
thus greatly reducing the amount of heap memory required to display
it.  This does not seem to be happening on the Droid/Android 2.0.

Is there something about how ListView works that I'm unaware of (with
regard to how memory is allocated per list item) or is something
working differently with regard to memory usage and fitXY scaling with
Android 2.0?

Thanks,
Derek

-- 
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] Widgets: controlling phone functionality

2009-12-10 Thread Derek
I'm a web developer who recently bought a Droid (Android 2.0) and was
wondering if it's possible to write a widget that controls certain
features of the phone (e.g. lock keypad, adjust screen brightness,
etc.)

Are there any tutorials that discuss this subject?

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: Crashed Service not restarting - TasKiller or Android issue ?

2009-11-27 Thread Derek
Hi Diane,

We've have exactly the same problem. We have TasKiller v2.2 installed
but we DO NOT use it to kill our app.
However, our service (running every one minute thanks to AlarmManager)
never restarts after process has died.
Here are the log extracted today on my HTC device under 1.6:
[...]
11-27 18:14:00.463: INFO/abc.RefreshService(1482): Alarm planned in
6 milliseconds at 125934210 (abc.refreshserv...@431e8178 -
PendingIntent{431f71f8: android.os.binderpr...@431f71b0})
11-27 18:14:00.463: INFO/abc.RefreshService(1482): RefreshService
stopping (abc.refreshserv...@431e8178)
11-27 18:14:00.463: INFO/ActivityManager(74): Stopping service:
abc/.xyz.RefreshService
[...]
11-27 18:15:07.629: INFO/ActivityManager(74): Process abc (pid 1482)
has died.
11-27 18:15:07.679: WARN/ActivityManager(74): Scheduling restart of
crashed service abc/.xyz.RefreshService in 5000ms
[...]
11-27 18:19:26.131: INFO/ActivityManager(74): Start proc abc for
service abc/.xyz.RefreshService: pid=1536 uid=10033 gids={3003, 1015}
11-27 18:19:26.241: INFO/dalvikvm(1536): Debugger thread not active,
ignoring DDM send (t=0x41504e4d l=38)
[...]

Do you mean that the problem could come from TaskKiller application ?
Once problem has occurred I still can see our app in TasKiller as
Italic/grayed (which means that a service is running in background) or
yellow.

Thanks.


On Nov 22, 8:53 pm, Dianne Hackborn hack...@android.com wrote:
 That's what the task killers do.  Don't use them if you don't want this to
 happen.  You can't get around this.  The API they are using is intended for
 the user to explicitly stop everything about an app.

 On Sat, Nov 21, 2009 at 6:53 PM, shahzad ahmad 
 shahzad.s.ah...@gmail.comwrote:

  Hi,
      I'm just investing how crashed services are restarted. I've developed a
  simple service and use a taskkiller from market place to kill the
  application. Following are the logs after application is killed

  Uninstalling the process test.sys
  Force removing process ProcessRecord{432d6ad0 252:test.sys/10041}
  (test.sys/10041)
  Scheduling restart of crashed service test.sys/.testservice in 5000ms
  Sending signal. PID: 252 SIG: 9

  But the service is never started. Can anybody tell why service is not
  starting? Do i need to put any flag in manifest file for service restart to
  work?

  Regards,
  shaz

  --
  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.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.

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


[android-developers] Re: Crashed Service not restarting - TasKiller or Android issue ?

2009-11-27 Thread Derek
Hi Nicolas,

Thanks for the feedback. I've double checked the logs and I don't see
anything about TasKiller when the process has died.
In the meantime I've read the following thread about developers
complaining about Task killers applications (not yours especially).
http://groups.google.com/group/android-developers/browse_thread/thread/3f87972d1f99ee81/e28b5180bb404a79
(Our users complain that widget updates stop too)

So, I've uninstalled TaskKiller, run GoogleMaps to generate a process
kill from Android. Here are the logs just after GoogleMaps starting:
[...]
11-27 19:25:47.494: INFO/ActivityManager(74): Process abc (pid 3509)
has died.
[...]
11-27 19:26:00.044: INFO/ActivityManager(74): Start proc abc for
service abc/.xyz.RefreshService: pid=3603 uid=10033 gids={3003, 1015}
[...]
11-27 19:26:00.424: INFO/abc.xyz.RefreshService(3603): RefreshService
started (abc.xyz.refreshserv...@431f1d38)
[...]
It seems to work now. The only difference is that the following trace
does not appear:
Scheduling restart of crashed service abc/.xyz.RefreshService in
5000ms.

Could it be a bug in your application ? or in the Android API you're
using to monitor running processes ?
It may prevent a service from restart. Is there any test I can do to
make sure ?

Thanks again.


On Nov 27, 7:25 pm, Nicolas Thibaut nthibau...@gmail.com wrote:
 Hi, Taskiller use ActivityManager to kill process (there is no kill
 but uninstall process).

 If I kill taskiller itselfs, the log are:

 11-27 19:16:58.952 I/ActivityManager(   75): Displayed activity
 com.tni.TasKiller/.TasKiller: 2023 ms (total 2023 ms)
 11-27 19:16:59.032 I/ActivityManager(   75): Process
 com.android.settings (pid 4361) has died.
 11-27 19:17:05.212 D/dalvikvm( 2816): GC freed 2448 objects / 115688
 bytes in 175ms
 11-27 19:17:12.842 D/ActivityManager(   75): Uninstalling process
 com.tni.TasKiller
 11-27 19:17:12.842 D/ActivityManager(   75): Force removing process
 ProcessRecord{43678608 4341:com.tni.TasKiller/10030}
 (com.tni.TasKiller/10030)

 If your service die without this log, Taskiller is not guilty !
 And if your service is killed by taskiller : the user HOPE it will
 NEVER restart.

 On Nov 27, 7:01 pm, Derek cram.de...@gmail.com wrote:

  Hi Diane,

  We've have exactly the same problem. We have TasKiller v2.2 installed
  but we DO NOT use it to kill our app.
  However, our service (running every one minute thanks to AlarmManager)
  never restarts after process has died.
  Here are the log extracted today on my HTC device under 1.6:
  [...]
  11-27 18:14:00.463: INFO/abc.RefreshService(1482): Alarm planned in
  6 milliseconds at 125934210 (abc.refreshserv...@431e8178 -
  PendingIntent{431f71f8: android.os.binderpr...@431f71b0})
  11-27 18:14:00.463: INFO/abc.RefreshService(1482): RefreshService
  stopping (abc.refreshserv...@431e8178)
  11-27 18:14:00.463: INFO/ActivityManager(74): Stopping service:
  abc/.xyz.RefreshService
  [...]
  11-27 18:15:07.629: INFO/ActivityManager(74): Process abc (pid 1482)
  has died.
  11-27 18:15:07.679: WARN/ActivityManager(74): Scheduling restart of
  crashed service abc/.xyz.RefreshService in 5000ms
  [...]
  11-27 18:19:26.131: INFO/ActivityManager(74): Start proc abc for
  service abc/.xyz.RefreshService: pid=1536 uid=10033 gids={3003, 1015}
  11-27 18:19:26.241: INFO/dalvikvm(1536): Debugger thread not active,
  ignoring DDM send (t=0x41504e4d l=38)
  [...]

  Do you mean that the problem could come from TaskKiller application ?
  Once problem has occurred I still can see our app in TasKiller as
  Italic/grayed (which means that a service is running in background) or
  yellow.

  Thanks.

  On Nov 22, 8:53 pm, Dianne Hackborn hack...@android.com wrote:

   That's what the task killers do.  Don't use them if you don't want this to
   happen.  You can't get around this.  The API they are using is intended 
   for
   the user to explicitly stop everything about an app.

   On Sat, Nov 21, 2009 at 6:53 PM, shahzad ahmad 
   shahzad.s.ah...@gmail.comwrote:

Hi,
    I'm just investing how crashed services are restarted. I've 
developed a
simple service and use a taskkiller from market place to kill the
application. Following are the logs after application is killed

Uninstalling the process test.sys
Force removing process ProcessRecord{432d6ad0 252:test.sys/10041}
(test.sys/10041)
Scheduling restart of crashed service test.sys/.testservice in 5000ms
Sending signal. PID: 252 SIG: 9

But the service is never started. Can anybody tell why service is not
starting? Do i need to put any flag in manifest file for service 
restart to
work?

Regards,
shaz

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

[android-developers] How to stop soft keyboard events for a disabled TextView ?

2009-11-25 Thread Derek
Hi,

I would like to stop end-user to enter characters in TextView on
specific conditions. I use TextView.setEnabled(false) it it works fine
for regular keyboard. However, if I use soft keyboard then all
characters are displayed in TextView even if it is disabled.

How to disable/enable soft keyboard events without hiding the soft
keyboard ?

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: AutoCompleteTextView update from thread problem

2009-11-25 Thread Derek
Anyone ?

On Nov 25, 8:56 am, Derek cram.de...@gmail.com wrote:
 Same problem here.
 Any solution ?

 I've tried to add
 textView.performValidation();
 textView.showDropDown();

 but it does not display drop down.

 On Nov 4, 6:42 pm, Tim timoth...@gmail.com wrote:

  I've posted this in a couple of places without any help so hopefully
  this group has some helpful people :)

  I have anAutoCompleteTextViewwhich I want to populate with artist
  names based on what the user types.

  The problem is that I have a thread for retrieving the names from
  awebservice, but when I try and update the ArrayAdapter with a
  Handler on the
  UI thread (which is called from thewebservice thread), nothing gets
  updated on screen.
  When I type another letter though, then the previous results fromweb
  service are displayed in theautocompletetextviewrather than the
  latest.

  1) Type 'abc'
  2)WebService gets 'abc1', 'abc2' and 'abc3' and calls Handler to
  notify GUI thread
  3) Set 'abc1', 'abc2' and 'abc3' on adapter using adapter.add(str)
  4) Call notifyDataSetChanged()
  5) Nothing changes on GUI :(
  6) Type another letter so textview reads 'abc1'
  7)WebService retrieves 'abc1x', 'abc1y' and 'abc1z' and calls
  Handler to notify GUI thread
  8) Set 'abc1x', 'abc1y' and 'abc1z' results on the adapter
  9) Call notifyDataSetChanged()
  10) GUI now shows 'abc1' (From step 3)

  Here is my code:

  public void onCreate(Bundle savedInstanceState) {
  ...
                 AutoCompleteTextViewactv = (AutoCompleteTextView)
  findViewById
  (R.id.artist_search_text_edit);
                  actv.addTextChangedListener(textWatcher);
                  adapter = new ArrayAdapterString(this,
  android.R.layout.simple_dropdown_item_1line, new ArrayListString());
                  actv.setAdapter(adapter);

          }

  TextWatcher textWatcher = new TextWatcher() {

                  @Override
                  public void onTextChanged(CharSequence s, int start,
  int before, int
  count) {
                          Thread t = new Thread() {
                                  public void run() {
                                          ArrayListString names =
  (ArrayListString) getArtistStrings
  (getInput());
                                          artistNames = names;
                                          messageHandler.sendEmptyMessage
  (0);
                                  }
                          };
                          t.start();
                  }

                  @Override
                  public void beforeTextChanged(CharSequence s, int
  start, int count,
  int after) {
                  }

                  @Override
                  public void afterTextChanged(Editable s) {
                  }
          };

  private String getInput() {
                  EditText artistInput = (EditText) findViewById
  (R.id.artist_search_text_edit);
                  String artistSearchString = artistInput.getText
  ().toString();
                  return artistSearchString;
          }

  private void updateTextAdapter(ListString data) {
                  adapter.clear();
                  for (String artistName : data) {
                          adapter.add(artistName);
                  }
                  adapter.notifyDataSetChanged();
          }

          private Handler messageHandler = new Handler() {

                  @Override
                  public void handleMessage(Message msg) {
                          updateTextAdapter(artistNames);
                  }

          };



-- 
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: AutoCompleteTextView update from thread problem

2009-11-24 Thread Derek
Same problem here.
Any solution ?

I've tried to add
textView.performValidation();
textView.showDropDown();

but it does not display drop down.

On Nov 4, 6:42 pm, Tim timoth...@gmail.com wrote:
 I've posted this in a couple of places without any help so hopefully
 this group has some helpful people :)

 I have an AutoCompleteTextView which I want to populate with artist
 names based on what the user types.

 The problem is that I have a thread for retrieving the names from
 a web service, but when I try and update the ArrayAdapter with a
 Handler on the
 UI thread (which is called from the web service thread), nothing gets
 updated on screen.
 When I type another letter though, then the previous results from web
 service are displayed in the autocompletetextview rather than the
 latest.

 1) Type 'abc'
 2) Web Service gets 'abc1', 'abc2' and 'abc3' and calls Handler to
 notify GUI thread
 3) Set 'abc1', 'abc2' and 'abc3' on adapter using adapter.add(str)
 4) Call notifyDataSetChanged()
 5) Nothing changes on GUI :(
 6) Type another letter so textview reads 'abc1'
 7) Web Service retrieves 'abc1x', 'abc1y' and 'abc1z' and calls
 Handler to notify GUI thread
 8) Set 'abc1x', 'abc1y' and 'abc1z' results on the adapter
 9) Call notifyDataSetChanged()
 10) GUI now shows 'abc1' (From step 3)

 Here is my code:

 public void onCreate(Bundle savedInstanceState) {
 ...
                 AutoCompleteTextView actv = (AutoCompleteTextView)
 findViewById
 (R.id.artist_search_text_edit);
                 actv.addTextChangedListener(textWatcher);
                 adapter = new ArrayAdapterString(this,
 android.R.layout.simple_dropdown_item_1line, new ArrayListString());
                 actv.setAdapter(adapter);

         }

 TextWatcher textWatcher = new TextWatcher() {

                 @Override
                 public void onTextChanged(CharSequence s, int start,
 int before, int
 count) {
                         Thread t = new Thread() {
                                 public void run() {
                                         ArrayListString names =
 (ArrayListString) getArtistStrings
 (getInput());
                                         artistNames = names;
                                         messageHandler.sendEmptyMessage
 (0);
                                 }
                         };
                         t.start();
                 }

                 @Override
                 public void beforeTextChanged(CharSequence s, int
 start, int count,
 int after) {
                 }

                 @Override
                 public void afterTextChanged(Editable s) {
                 }
         };

 private String getInput() {
                 EditText artistInput = (EditText) findViewById
 (R.id.artist_search_text_edit);
                 String artistSearchString = artistInput.getText
 ().toString();
                 return artistSearchString;
         }

 private void updateTextAdapter(ListString data) {
                 adapter.clear();
                 for (String artistName : data) {
                         adapter.add(artistName);
                 }
                 adapter.notifyDataSetChanged();
         }

         private Handler messageHandler = new Handler() {

                 @Override
                 public void handleMessage(Message msg) {
                         updateTextAdapter(artistNames);
                 }

         };

-- 
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: Picture location on HTC sense phones

2009-11-22 Thread Derek
Agree we are seeing the same thing.  Haven't found any solution yet.
In Sense UI seems like HTC wrote their own camera app that is
listening to the same intent as the default Android camera but not
conforming to the same interface contract as the Android code.

Anyone else find a fix to this?


On Nov 5, 6:27 am, SCMSoft scms...@gmail.com wrote:
 (The message was accidentally sent, here is the full one:)

 Hi,
 We have multiple apps that save pictures to the phone. We use the
 following code for that:

         ContentValues values = new ContentValues();
         values.put(MediaStore.Images.Media.DISPLAY_NAME, Photo);
         values.put(MediaStore.Images.Media.DESCRIPTION, Camera
 Pro);
         values.put(MediaStore.Images.Media.MIME_TYPE, image/jpeg);
         values.put(MediaStore.Images.Media.DATE_TAKEN,
 System.currentTimeMillis());
         Uri uri = getContentResolver().insert
 (MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);

         ... save Image to getContentResolver().openOutputStream
 (uri) ...

 This works fine on the G1 and a Samsung Galaxy, but on HTC phones with
 thesenseUI, the photos seem to be stored in a different location.
 The HTC Albums app doesn't pick these photos up and to the user it
 seems like the photos are not there at all. Also the default gallery
 app is not present.
 Is there a way to save images in the right place always? Can any
 phone manufacturer just choose to shuffle things around like this? It
 seems to make it unnecesarily hard on app developers if there are no
 standards.

 Best regards,

 Swiss Codemonkey team.

-- 
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] Service runnning while PowerManager decides to sleep ?

2009-11-20 Thread Derek
Hi all,

Our application is running a service periodically through AlarmManager
and PendingIntent. Each time the service runs, it sets a new
PendingItent for next run. I works fine but sometimes the service
stops for no reason.
- Could it come from PowerManager?
- Could the CPU goes off before the end of the service?
- Should we setup a WakeLock within the service to prevent from CPU to
go off?

Thanks for any advice.

-- 
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: Service runnning while PowerManager decides to sleep ?

2009-11-20 Thread Derek
Thanks for the answer Dianne.

So, is it a good idea to acquire a WakeLock at the beginning of the
service and release it at the end just after setting the PendingIntent
through AlarmManager ?

Also, is it possible to simulate CPU to go off with Emulator ? or
forcing CPU to go off with real device connected to DDMS through USB ?

Cheers.

On Nov 20, 9:10 pm, Dianne Hackborn hack...@android.com wrote:
 If you don't hold a wake lock, you can't count on the CPU running.



 On Fri, Nov 20, 2009 at 12:01 PM, Derek cram.de...@gmail.com wrote:
  Hi all,

  Our application is running a service periodically through AlarmManager
  and PendingIntent. Each time the service runs, it sets a new
  PendingItent for next run. I works fine but sometimes the service
  stops for no reason.
  - Could it come from PowerManager?
  - Could the CPU goes off before the end of the service?
  - Should we setup a WakeLock within the service to prevent from CPU to
  go off?

  Thanks for any advice.

  --
  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.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.

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


[android-developers] Re: AppWidgetProvider SCREEN_ON/OFF Intent not received

2009-11-16 Thread Derek
Anyone ?
No fix for this issue in 1.6 or 2.0 ?

Thanks.

On Nov 15, 9:07 pm, Derek cram.de...@gmail.com wrote:
 Hi,

 We've an AppWidgetProvider and we would like to receive SCREEN_ON.
 From the following thread, it seems not possible to register for such
 event in 
 AndroidManifest.xmlhttp://groups.google.com/group/android-developers/browse_thread/threa...

 The thread reports that registration must be done with API. It works
 fine for an Activity but it is not allowed from a AppWidgetProvider
 which is already a BroadcastReceiver. Is there any solution ?

 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] AppWidgetProvider SCREEN_ON/OFF Intent not received

2009-11-15 Thread Derek
Hi,

We've an AppWidgetProvider and we would like to receive SCREEN_ON.
From the following thread, it seems not possible to register for such
event in AndroidManifest.xml
http://groups.google.com/group/android-developers/browse_thread/thread/40753eb1b312f4ab/3e171b45a2fe880c?#3e171b45a2fe880c

The thread reports that registration must be done with API. It works
fine for an Activity but it is not allowed from a AppWidgetProvider
which is already a BroadcastReceiver. Is there any solution ?

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] Play MP3 in background with built-in player activity ?

2009-11-11 Thread Derek
Hi,

Playing MP3 from the following code works fine:

Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
File file = new File(your mp3);
intent.setDataAndType(Uri.fromFile(file), audio/*);
startActivity(intent);

This launches the built in MediaPlaybackActivity and begins playing
the
desired track. However, I'm now trying to figure out to keep that
track playing when you back out of the MediaPlaybackActivity. My
problem is that when you back out of the MediaPlaybackActivity, the
track stops.

Is is possible ? Is there any extra intent ?

Thanks for your help.

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


[android-developers] Re: ADC2 Results Post

2009-11-05 Thread Derek
Same here: Top 50% but did not make it.
WorldTime has been published on Market (as WorldWideTime) in
September. It has reached rank #9 in Travel category in 3 weeks
according to http://androidstats.com/ranking/application/13459 but
it's not in top 20 of ADC2 travel category.



-- 
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: ADC2 Results Post

2009-11-05 Thread Derek
Yes, 2 identical emails received too.

On Nov 5, 10:21 pm, ander...@phdgaming.com ander...@phdgaming.com
wrote:
 Alex - thanks for the positive note, appreciate it. :) Indeed I has
 the same experience as to the competition in the Education category -
 hence why I figured that Mystic Maggie would at least make top 20.
 Very surprised Vivify Picture didn't make it either - indeed does seem
 that voters must have preferred what they have seen before over
 originality.

 On a side note, Google just sent me a *second* rejection email
 identical to the first one 4 minutes ago for the same application?
 Anyone else have that happen?

 On Nov 5, 3:56 pm, Alex iiiypu...@gmail.com wrote:

  I've voted all 5s but 4 for polish for your app in round 1, really
  liked your app.

  Ours (vivify picture) also failed to make it to top 20 education
  titles, being in bottom 50% too. I think that's for all apps, not just
  education category.

  When judging, I've seen about 5 original apps in the category
  inclucing yours, and everything else were just quizes. So proabbly in
  education 20 quiz apps will be competing with each other in round 2.

  On Nov 5, 9:46 pm, ander...@phdgaming.com ander...@phdgaming.com
  wrote:

   I got an email saying my application Mystic Maggie Story 
   (http://www.phdgaming.com/general_media/mm/) was ranked in the bottom
   50%. As it was top 20 from each category that moved on, I assume that
   means it was in the bottom 50% for education.

   Really thought I would have at least made top 20 in the education
   category. :/ Oh well.



-- 
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: API responsable to make transfert dwonlaod ,upload with ftp ou 3G protocol

2009-11-01 Thread Derek
Try AndFTP 1.0:

Recent changes are:
- SHIFT-JIS encoding added for Japanese server.
- Japanese support added.
- SFTP minor bug fixed.
- Microsoft office mime-types added.
- Android 1.6 and 2.0 support added.

http://www.lysesoft.com/products/andftp/index.html

Cheers.

On Oct 1, 10:55 am, midoub elmehdi.benso...@gmail.com wrote:
 hi,
 please someone know wich APIs it's are responsable to transfer data 
 onftp,download or upload.
 I want use this APIs to create application .
 any suggestions are welcome.
 thank you for your help.

 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] Widget not displayed in Android 2.0 - Initial layout displayed only.

2009-11-01 Thread Derek
Our application displays widgets that update every minute through
Alarm. It works fine under 1.5 and 1.6 but since 2.0, widget is not
displayed at all. Only initial layout is displayed.

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


[android-developers] Re: Widget not displayed in Android 2.0 - Initial layout displayed only.

2009-11-01 Thread Derek
After investigations we've noticed that this problem occurs when you
create a new AVD with Google API 2.0 (level5) only.
On the first emulator launch with new AVD the widget stays on Initial
Layout.
Closing the emulator and restart with the same AVD seems to work.

What could be the problem ?

Adding analog clock widget works in any case.

Thanks.

On Nov 1, 6:33 pm, Derek cram.de...@gmail.com wrote:
 Our application displays widgets that update every minute through
 Alarm. It works fine under 1.5 and 1.6 but since 2.0, widget is not
 displayed at all. Only initial layout is displayed.

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


[android-developers] [ANN] WorldWide Time widget

2009-09-20 Thread Derek

WorldWideTime is an application that displays time in cities all
around the world with widgets. It can display date, week number and
extra info such as country, state, currency, phone code, population,
area in square km, country capital, GMT offset, DST start/end date and
time zone.

http://www.lysesoft.com/products/worldwidetime/index.html

Have fun.
--~--~-~--~~~---~--~~
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: Hmm... at last ADC2 is out of our way ... tell about your app and experience

2009-09-03 Thread Derek

Another application:

- Name: WorldTime
- Homepage  screenshots: http://www.lysesoft.com/products/worldtime/index.html
- Category: Travel
- Description:
  WorldTime is an application that displays time in cities all around
the world
  with widgets. It can display date, week number and extra info such
as country,
  state, currency, phone code, population, area in square km, country
capital,
  GMT offset, DST start/end date and time zone. 12-hour and 24-hour
clock setup
  are available. Map with satellite view can be displayed for each
city.
  WorldTime helps when you travel or when you make business abroad by
providing
  local time and useful information about cities.
- Feedback:
  Time spent to workaround small issues of the widget framework.

It will be available for download and on the market 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: Force screen orientation and avoid destroy call

2009-08-28 Thread Derek

Another question:
android:screenOrientation=portrait locks the screen orientation,
that's fine.
But it is possible to do the same in Activity source code ? (i.e.
removing the screenOrientation in AndroidManifest.xml).

I've tried the following code to keep the initial orientation but it
fails.

private int initialOrientation =
Configuration.ORIENTATION_UNDEFINED;

public void onCreate(Bundle savedInstanceState) {
initialOrientation = getResources().getConfiguration
().orientation;
...
}

public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
setRequestedOrientation(initialOrientation);
}

I've also tried with:
initialOrientation = getResources().getConfiguration().orientation;
initialOrientation = getRequestedOrientation();
initialOrientation = getWindow().getWindowManager().getDefaultDisplay
().getOrientation();


Thanks for the help.

On Aug 27, 9:54 pm, Mark Murphy mmur...@commonsware.com wrote:
  I want my Activity to be always in portrait mode and I do NOT want the
  onDestroy() method to be called.
  There are some interesting articles about that at:
 http://www.androidguys.com/2008/11/24/rotational-forces-part-four/

  The solution seems to be:
  In AndroidManifest.xml:
          activity android:name=.MyActivity
                       android:screenOrientation=portrait
                       android:configChanges=keyboardHidden|orientation

  In Activity code:
      public void onConfigurationChanged(Configuration newConfig)
      {
             super.onConfigurationChanged(newConfig);
      }

  I've tried it and it seems to work. Is there any other alternative or
  is it the correct solution?

 Well, I think it's the correct solution. But, then again, I'm biased in
 favor of the author of that fine, upstanding blog post.

 ;-)

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.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: Force screen orientation and avoid destroy call

2009-08-28 Thread Derek

It seems that constants returned and expected are not the same between
ActivityInfo and Configuration.
Translating Configuration constants to ActivityInfo seems to solve the
problem:

 int orientation = getResources().getConfiguration().orientation;
 if (orientation == Configuration.ORIENTATION_PORTRAIT)
initialOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
 else if (orientation == Configuration.ORIENTATION_LANDSCAPE)
initialOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;

Mark, do you think it's OK ?

Cheers.


On Aug 28, 7:06 pm, Derek cram.de...@gmail.com wrote:
 Another question:
 android:screenOrientation=portrait locks the screen orientation,
 that's fine.
 But it is possible to do the same in Activity source code ? (i.e.
 removing the screenOrientation in AndroidManifest.xml).

 I've tried the following code to keep the initial orientation but it
 fails.

     private int initialOrientation =
 Configuration.ORIENTATION_UNDEFINED;

     public void onCreate(Bundle savedInstanceState) {
         initialOrientation = getResources().getConfiguration
 ().orientation;
         ...
     }

     public void onConfigurationChanged(Configuration newConfig)
     {
         super.onConfigurationChanged(newConfig);
         setRequestedOrientation(initialOrientation);
     }

 I've also tried with:
 initialOrientation = getResources().getConfiguration().orientation;
 initialOrientation = getRequestedOrientation();
 initialOrientation = getWindow().getWindowManager().getDefaultDisplay
 ().getOrientation();

 Thanks for the help.

 On Aug 27, 9:54 pm, Mark Murphy mmur...@commonsware.com wrote:

   I want my Activity to be always in portrait mode and I do NOT want the
   onDestroy() method to be called.
   There are some interesting articles about that at:
  http://www.androidguys.com/2008/11/24/rotational-forces-part-four/

   The solution seems to be:
   In AndroidManifest.xml:
           activity android:name=.MyActivity
                        android:screenOrientation=portrait
                        android:configChanges=keyboardHidden|orientation

   In Activity code:
       public void onConfigurationChanged(Configuration newConfig)
       {
              super.onConfigurationChanged(newConfig);
       }

   I've tried it and it seems to work. Is there any other alternative or
   is it the correct solution?

  Well, I think it's the correct solution. But, then again, I'm biased in
  favor of the author of that fine, upstanding blog post.

  ;-)

  --
  Mark Murphy (a Commons Guy)http://commonsware.com
  Android App Developer Books:http://commonsware.com/books.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] Force screen orientation and avoid destroy call

2009-08-27 Thread Derek

Hi,

I want my Activity to be always in portrait mode and I do NOT want the
onDestroy() method to be called.
There are some interesting articles about that at:
http://www.androidguys.com/2008/11/24/rotational-forces-part-four/

The solution seems to be:
In AndroidManifest.xml:
activity android:name=.MyActivity
  android:screenOrientation=portrait
  android:configChanges=keyboardHidden|orientation


In Activity code:
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
}

I've tried it and it seems to work. Is there any other alternative or
is it the correct solution?

Thanks for your advice.

--~--~-~--~~~---~--~~
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: Force screen orientation and avoid destroy call

2009-08-27 Thread Derek

Thanks Mark :-)


On Aug 27, 9:54 pm, Mark Murphy mmur...@commonsware.com wrote:
  I want my Activity to be always in portrait mode and I do NOT want the
  onDestroy() method to be called.
  There are some interesting articles about that at:
 http://www.androidguys.com/2008/11/24/rotational-forces-part-four/

  The solution seems to be:
  In AndroidManifest.xml:
          activity android:name=.MyActivity
                       android:screenOrientation=portrait
                       android:configChanges=keyboardHidden|orientation

  In Activity code:
      public void onConfigurationChanged(Configuration newConfig)
      {
             super.onConfigurationChanged(newConfig);
      }

  I've tried it and it seems to work. Is there any other alternative or
  is it the correct solution?

 Well, I think it's the correct solution. But, then again, I'm biased in
 favor of the author of that fine, upstanding blog post.

 ;-)

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.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] PendingIntent Flag and AlarmManager behavior ?

2009-08-04 Thread Derek

Hi all,

The PendingIntent documentation describes flags.
http://developer.android.com/reference/android/app/PendingIntent.html

public static PendingIntent getService (Context context, int
requestCode, Intent intent, int flags)
Flags values could be:
FLAG_CANCEL_CURRENT:268435456
FLAG_NO_CREATE:536870912
FLAG_ONE_SHOT:1073741824
FLAG_UPDATE_CURRENT:134217728

I'm using the following code:
PendingIntent pendingIntent = PendingIntent.getService(this, 0,
updateIntent, 0);
AlarmManager alarmManager = (AlarmManager)getSystemService
(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC, nextUpdate, pendingIntent);

I'm passing zero as flag value. What flag is used then ?

Whatever number of calls to alarmManager.set() with different time,
only the last pending intent instance is taken into account. All
previous ones seem ignored. Is this behavior related to PendingIntent
flag ? Documentation says that requestcode is not used?

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: Bug report: widget does not load if the orientation changes during the configuration

2009-08-03 Thread Derek

Are you sure forcing portrait mode for configuration activity could
solve the problem ?
I've tried to add: android:screenOrientation=portrait to my activity
and the problem is still here.
The activity is displayed in portrait whatever the orientation but the
phantom widget bug is still here.

On Jul 13, 9:15 pm, Jeff Sharkey jshar...@android.com wrote:
 Thanks for catching this--it's a known issue and an engineer has been
 assigned to it.  :)  There really isn't a good workaround in 1.5,
 other than forcing the configuration activity into portrait mode or
 asking users to rotate before returning.

 j



 On Sun, Jul 12, 2009 at 3:19 PM, Pablo Perapablo...@gmail.com wrote:

  Hi,

  I'd like to report a bug we just found while writing a widget.

  Summary: There is a widget installed, that defines a configuration
  activity. If the user changes the orientation while they are in the
  configuration activity, and they finish that activity in a different
  orientation that they started, the widget does NOT appear in the home
  screen after the configuration is done.

  How to reproduce: have a minimal widget, with a configuration activity
  that contains a button, which correctly updates the App Widget when it
  is clicked (as explained 
  inhttp://developer.android.com/guide/topics/appwidgets/index.html#Confi...).
  Add a new instance of the widget, so the config screen shows up.
  Change the orientation once. Click on the button. Your widget does not
  appear in the home screen. (Ouch.)

  If this has already been reported, or if there's a better way to
  submit a bug report, please let me know!

  Thanks,

  Pablo

 --
 Jeff Sharkey
 jshar...@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-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: Paid applications and market feedback/rating

2009-06-26 Thread Derek

I think another option is to add ads (adMob or google AdSense) into
the app. You may not need a paid version.
--~--~-~--~~~---~--~~
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] WebView Dialog Activity

2009-06-22 Thread Derek

We had an activity that simply created a WebView object and loaded a
single URL.  In the manifest we had it declared to use the Dialog
theme.  Everything worked perfectly well with Android 1.1

Now that we have upgraded to 1.5, the dialog loads with only the
title.  None of the webview loads at all.  Is this a bug in 1.5,
intended design, or did something change?

Here's the code that worked in Android 1.1:

public class HelpPages extends Activity {

private WebView wv;

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

String helpTopic = this.getIntent().getStringExtra(helpTopic);
String startPage = http://www.oursite.com#;
+ helpTopic;

wv = new WebView(this);
wv.loadUrl(startPage);
setContentView(wv);
}
}


Thanks,
Derek
--~--~-~--~~~---~--~~
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: WebView Dialog Activity

2009-06-22 Thread Derek

Thanks for the quick response.  My responses to your questions:

 -- Does your page require Javascript? If so, have you tried enabling
 Javascript?

No Javascript used (its pretty much begin/end tags with plain text)

 -- Have you tried it without the Dialog theme?

Yes and that works but we'd like the Dialog to work for aesthetic
purposes

 -- Have you tried using a layout file rather than directly creating a
 WebView instance?

Yes, that also doesn't work

 -- Have you tried some URL without the # syntax?

Yes also doesn't work

There are no exceptions in the Log so that makes this even more
frustrating because it appears to all be working but nothing is
displayed.


On Jun 22, 7:17 pm, Mark Murphy mmur...@commonsware.com wrote:
 Derek wrote:
  We had an activity that simply created a WebView object and loaded a
  single URL.  In the manifest we had it declared to use the Dialog
  theme.  Everything worked perfectly well with Android 1.1

  Now that we have upgraded to 1.5, the dialog loads with only the
  title.  None of the webview loads at all.  Is this a bug in 1.5,
  intended design, or did something change?

  Here's the code that worked in Android 1.1:

  public class HelpPages extends Activity {

     private WebView wv;

     public void onCreate(Bundle savedInstanceState) {
             super.onCreate(savedInstanceState);

             String helpTopic = this.getIntent().getStringExtra(helpTopic);
             String startPage = http://www.oursite.com#;
                             + helpTopic;

             wv = new WebView(this);
             wv.loadUrl(startPage);
             setContentView(wv);
     }
  }

 Some random suggestions:

 -- Does your page require Javascript? If so, have you tried enabling
 Javascript?

 -- Have you tried it without the Dialog theme?

 -- Have you tried using a layout file rather than directly creating a
 WebView instance?

 -- Have you tried some URL without the # syntax?

 WebView definitely works in Android 1.5. With all but the first
 suggestion, I'm merely trying to identify things that differ between the
 way I've used it in my testing versus the code snippet you show above.

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

 Warescription: Three Android Books, Plus Updates, $35/Year
--~--~-~--~~~---~--~~
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: WebView Dialog Activity

2009-06-22 Thread Derek

Tried the setLayoutParams() with no luck :(

The xml layout I tried from Mark's suggestion also had the width,
height set to fill_parent.


On Jun 22, 7:55 pm, Jeff Sharkey jshar...@android.com wrote:
 This might be related to the layout measuring pass.  Try
 setLayoutParams() on the WebView with both dimensions as FILL_PARENT
 before calling setContentView().

 j



 On Mon, Jun 22, 2009 at 5:50 PM, Mark Murphymmur...@commonsware.com wrote:

  Derek wrote:
  Thanks for the quick response.  My responses to your questions:

  -- Does your page require Javascript? If so, have you tried enabling
  Javascript?

  No Javascript used (its pretty much begin/end tags with plain text)

  -- Have you tried it without the Dialog theme?

  Yes and that works but we'd like the Dialog to work for aesthetic
  purposes

  -- Have you tried using a layout file rather than directly creating a
  WebView instance?

  Yes, that also doesn't work

  -- Have you tried some URL without the # syntax?

  Yes also doesn't work

  OK, so it's definitely tied to a Dialog theme. Sorry for all the
  questions, but I wasn't sure if you had tried those sorts of things.

  Sounds like a bug to me. AFAIK, themes should not interfere with the
  operation of any specific widget type.

  If you can create a separate test project that demonstrates the error,
  post an issue tohttp://b.android.com, and post the issue URL to this list.

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

  Warescription: Three Android Books, Plus Updates, $35/Year

 --
 Jeff Sharkey
 jshar...@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-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: WebView Dialog Activity

2009-06-22 Thread Derek

Very interesting...

Upon loading the view in the Hierarchy viewer I end up with a
hierarchy like this:

PhoneWindow$DecorView
   |
  LinearLayout
 /\
TextView  FrameLayout
   |
   FrameLayout
   |
WebView

If I look at each view walking up the tree, they all look like I would
expect (the full webview is loaded) until I click on the PhoneWindow
$DecorView.  That is just showing the blank title.  It seems like the
title TextView is the only part of the LinearLayout (the LinearLayout
looks like it should with fully populated WebView and title)
displaying once PhoneWindow$DecorView loads.

Does this mean we have an Android bug?

On Jun 22, 8:40 pm, Mark Murphy mmur...@commonsware.com wrote:
 Derek wrote:
  Tried the setLayoutParams() with no luck :(

  The xml layout I tried from Mark's suggestion also had the width,
  height set to fill_parent.

 Jeff does bring up a good point, though. You could examine your activity
 in hierarchyviewer and see if anything seems odd with the WebView -- off
 the edge of the window, zero size, etc.

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

 Android Development Wiki:http://wiki.andmob.org
--~--~-~--~~~---~--~~
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: WebView Dialog Activity

2009-06-22 Thread Derek

Height is 0 in HierarchyViewer for the webview and both FrameLayouts.
The height of the LinearLayout is 53 which is also what the height of
the textview (title) is.  Seems strange that the height is showing as
0 in the properties of HierarchyViewer but the DisplayView shows a
fully populated screen.

I tried manually setting the layoutParams to a pixel size using the
following code:
wv = new WebView(this);
wv.loadUrl(startPage);
LayoutParams params = new LayoutParams(260,260);
wv.setLayoutParams(params);
setContentView(wv);

But didn't have any luck in seeing a change in the HierarchyViewer
height (or width).


On Jun 22, 9:53 pm, Dianne Hackborn hack...@android.com wrote:
 What is the size of the WebView/FrameLayout objects?  What happens if you
 try setting the web view to a fixed size?



 On Mon, Jun 22, 2009 at 7:49 PM, Derek dlawl...@gmail.com wrote:

  Very interesting...

  Upon loading the view in the Hierarchy viewer I end up with a
  hierarchy like this:

  PhoneWindow$DecorView
                |
       LinearLayout
              /        \
  TextView          FrameLayout
                                |
                        FrameLayout
                                |
                         WebView

  If I look at each view walking up the tree, they all look like I would
  expect (the full webview is loaded) until I click on the PhoneWindow
  $DecorView.  That is just showing the blank title.  It seems like the
  title TextView is the only part of the LinearLayout (the LinearLayout
  looks like it should with fully populated WebView and title)
  displaying once PhoneWindow$DecorView loads.

  Does this mean we have an Android bug?

  On Jun 22, 8:40 pm, Mark Murphy mmur...@commonsware.com wrote:
   Derek wrote:
Tried the setLayoutParams() with no luck :(

The xml layout I tried from Mark's suggestion also had the width,
height set to fill_parent.

   Jeff does bring up a good point, though. You could examine your activity
   in hierarchyviewer and see if anything seems odd with the WebView -- off
   the edge of the window, zero size, etc.

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

   Android Development Wiki:http://wiki.andmob.org

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView Dialog Activity

2009-06-22 Thread Derek

Ok that seems to fix it.   But why is that?  Seems risky to be setting
concrete pixel sizes like that with future devices not necessarily the
same size as G1.

Thanks for all the help...any other insight you can give to get us to
a more future-friendly solution is appreciated!

On Jun 22, 10:47 pm, Dianne Hackborn hack...@android.com wrote:
 You aren't setting the layout params correctly; you need to call the version
 of setContentView() that takes a LayoutParams argument.



 On Mon, Jun 22, 2009 at 8:31 PM, Derek dlawl...@gmail.com wrote:

  Height is 0 in HierarchyViewer for the webview and both FrameLayouts.
  The height of the LinearLayout is 53 which is also what the height of
  the textview (title) is.  Seems strange that the height is showing as
  0 in the properties of HierarchyViewer but the DisplayView shows a
  fully populated screen.

  I tried manually setting the layoutParams to a pixel size using the
  following code:
                  wv = new WebView(this);
                 wv.loadUrl(startPage);
                  LayoutParams params = new LayoutParams(260,260);
                 wv.setLayoutParams(params);
                 setContentView(wv);

  But didn't have any luck in seeing a change in the HierarchyViewer
  height (or width).

  On Jun 22, 9:53 pm, Dianne Hackborn hack...@android.com wrote:
   What is the size of the WebView/FrameLayout objects?  What happens if you
   try setting the web view to a fixed size?

   On Mon, Jun 22, 2009 at 7:49 PM, Derek dlawl...@gmail.com wrote:

Very interesting...

Upon loading the view in the Hierarchy viewer I end up with a
hierarchy like this:

PhoneWindow$DecorView
              |
     LinearLayout
            /        \
TextView          FrameLayout
                              |
                      FrameLayout
                              |
                       WebView

If I look at each view walking up the tree, they all look like I would
expect (the full webview is loaded) until I click on the PhoneWindow
$DecorView.  That is just showing the blank title.  It seems like the
title TextView is the only part of the LinearLayout (the LinearLayout
looks like it should with fully populated WebView and title)
displaying once PhoneWindow$DecorView loads.

Does this mean we have an Android bug?

On Jun 22, 8:40 pm, Mark Murphy mmur...@commonsware.com wrote:
 Derek wrote:
  Tried the setLayoutParams() with no luck :(

  The xml layout I tried from Mark's suggestion also had the width,
  height set to fill_parent.

 Jeff does bring up a good point, though. You could examine your
  activity
 in hierarchyviewer and see if anything seems odd with the WebView --
  off
 the edge of the window, zero size, etc.

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

 Android Development Wiki:http://wiki.andmob.org

   --
   Dianne Hackborn
   Android framework engineer
   hack...@android.com

   Note: please don't send private questions to me, as I don't have time to
   provide private support, and so won't reply to such e-mails.  All such
   questions should be posted on public forums, where I and others can see
  and
   answer them.

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Multiple ItemizedOverlay conflicts

2009-06-07 Thread Derek

For anyone else who runs into this (if they do) I figured out the
problem.  My custom ItemizedOverlay onTap method was calling the super
class onTap to return the boolean.  This is incorrect because the
ItemizedOverlay onTap by default always returns false meaning that
overlay did not handle the onTap and it should cycle through to the
next overlay.  Subclasses should override this to return true if the
onTap was handled.  This explained why it was popping a Toast for each
of the 4 overlay instances.

//Incorrect overridden onTap:
   protected boolean onTap(int index) {
//Do stuff
return super.onTap(index);
}

//Correct overridden onTap:
  protected boolean onTap(int index) {
//Do stuff
return true;
}


On Jun 4, 11:03 pm, Derek dlawl...@gmail.com wrote:
 Searched around and haven't seen anyone complaining about this so I
 guess I'll toss it out.  Our app uses a MapView and we create 4
 instances of a custom ItemizedOverlay object and add all to the
 MapView overlays.

 Our app creates events and based on the event type, adds it to the
 appropriate instance of the custom ItemizedOverlay.  Everything
 displays fine, they each have a different marker so its easy to see
 one set versus another.  The custom ItemizedOverlay has an overridden
 onTap(int index) to show a Toast with some info about the item.

 The problem occurs once there are events in 2 or more of the custom
 ItemizedOverlay instances.  Tapping one of the markers causes the
 other ItemizedOverlays to respond to onTap as well, regardless of
 whether they are close on the map or not.

 Has anyone seen anything like this?  Found a way around it?  I'm
 wondering if the problem is the fact that all 4 instances are of the
 same type but it still seems strange behavior.  Thoughts anyone?

 Thanks,
 Derek
--~--~-~--~~~---~--~~
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] Multiple ItemizedOverlay conflicts

2009-06-04 Thread Derek

Searched around and haven't seen anyone complaining about this so I
guess I'll toss it out.  Our app uses a MapView and we create 4
instances of a custom ItemizedOverlay object and add all to the
MapView overlays.

Our app creates events and based on the event type, adds it to the
appropriate instance of the custom ItemizedOverlay.  Everything
displays fine, they each have a different marker so its easy to see
one set versus another.  The custom ItemizedOverlay has an overridden
onTap(int index) to show a Toast with some info about the item.

The problem occurs once there are events in 2 or more of the custom
ItemizedOverlay instances.  Tapping one of the markers causes the
other ItemizedOverlays to respond to onTap as well, regardless of
whether they are close on the map or not.

Has anyone seen anything like this?  Found a way around it?  I'm
wondering if the problem is the fact that all 4 instances are of the
same type but it still seems strange behavior.  Thoughts anyone?

Thanks,
Derek
--~--~-~--~~~---~--~~
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: video capture doesn't seem to work in 1.5

2009-05-30 Thread Derek

I'm having trouble too and it seems to revolve around the prepare()
when it is trying to load up the file location.  I get a
FileNotFoundException during prepare().  The exception says it can't
find /external/video/media/5 which is the URI path.  I'm guessing it
wants a more physical path but even hard coding a path and giving a
filename results in another FileNotFoundException for that path /
sdcard/video/file.3gp.

I'm guessing if you look through your log you will see a warning with
the same FileNotFoundException.

On May 29, 5:31 am, zeeshan genx...@gmail.com wrote:
 is anybody come across the same problem or anyone have a working video
 capture example.

 your help is appreciated

 waiting for the help

 On May 29, 9:17 am, zeeshan genx...@gmail.com wrote:

  Activity just close at recorder.prepare();
  dont see any exception

  On May 28, 5:30 pm, Marco Nelissen marc...@android.com wrote:

   What do you mean by no luck? Does something crash? Do you get an
   exception? Does it create the recording file? Is there any data in it?

   On Thu, May 28, 2009 at 9:25 AM, zeeshan genx...@gmail.com wrote:

Hi dear,

i am trying to capture video since a week but still no luck.
can anybody help me to figure out what i am missing in the code below:

final MediaRecorder recorder = new MediaRecorder();
                                       ContentValues values = new
ContentValues(3);

 values.put(MediaStore.MediaColumns.TITLE,
Recorded video);
                                   values.put
(MediaStore.MediaColumns.DATE_ADDED, System.currentTimeMillis());
                                  // values.put
(MediaStore.MediaColumns.MIME_TYPE, recorder.getMimeContentType());

                                   Uri newUri = 
getContentResolver().insert
(Media.EXTERNAL_CONTENT_URI, values);
                                   //String path = getContentResolver()
   getDataFilePath(newUri);
                                   //final String 
filePath=newUri.toString
();

                                       final String
filePath=/sdcard/lion-seul.3gp;
                                       recorder.setAudioSource
(MediaRecorder.AudioSource.MIC);
                                       recorder.setVideoSource
(MediaRecorder.VideoSource.CAMERA);
                                       recorder.setOutputFormat
(MediaRecorder.OutputFormat.THREE_GPP);
                                       recorder.setAudioEncoder
(MediaRecorder.AudioEncoder.AMR_NB);

                                       //recorder.setVideoSize(176, 
144);
// QCIF

                                       //recorder.setOutputFormat
(MediaRecorder.OutputFormat.MPEG_4);
                                       recorder.setVideoEncoder
(MediaRecorder.VideoEncoder.MPEG_4_SP);
                                       recorder.setOutputFile(filePath);
                                       //
CameraView.thisCameraView.setRequestedOrientation

 //(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
                                       SurfaceHolder holder;

 videosurface.setVisibility(View.VISIBLE);
                                       holder = 
videosurface.getHolder();

 recorder.setPreviewDisplay(holder.getSurface
());

                                       try {

 recorder.prepare();
                                                               } catch
(IllegalStateException e) {
                                                                       
//
TODO Auto-generated catch block

 e.printStackTrace();
                                                               } catch
(IOException e) {
                                                                       
//
TODO Auto-generated catch block

 e.printStackTrace();
                                                               }
                                                               catch
(Exception e) {
                                                                       
//
TODO Auto-generated catch block

 e.printStackTrace();
                                                               }
                                       recorder.start();
--~--~-~--~~~---~--~~
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: ScrollView Dynamically Adding Text to TextView...

2009-05-26 Thread Derek Henderson

Does anyone have an idea of what I may be doing wrong?
--~--~-~--~~~---~--~~
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] ScrollView Dynamically Adding Text to TextView...

2009-05-25 Thread Derek Henderson

Alright, I'm majorly stumped here... All I am trying to do is make a
ScrollView scroll to the bottom of the TextView when the activity is
launched.

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent


ScrollView
android:id=@+id/currScroll
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=380px
android:background=#ff

TextView
android:id=@+id/currConversation
android:layout_width=fill_parent
android:layout_height=wrap_content
android:textColor=#00
android:background=#ff
android:textSize=18sp
/

/ScrollView

Button android:id=@+id/sendMessage
android:layout_column=0
android:layout_width=fill_parent
android:layout_height=wrap_content
android:text=@string/new_message
/

/LinearLayout

And here is the code...:

@Override
public void onResume() {
super.onResume();

ScrollView currScroll = (ScrollView) 
findViewById(R.id.currScroll);
currScroll.fling(-1);
Toast.makeText(this, Max:  + currScroll.getMaxScrollAmount(),
Toast.LENGTH_LONG).show();
}

The text is being added to currConversation dynamically in the
onCreate function using setText().The problem seems to be that no
matter how much text is in the TextView getMaxScrollAmount() always
returns 0.

I have tried scrollTo(), scrollBy(), fullScroll()!! Any help is
greatly appreciated!

--~--~-~--~~~---~--~~
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] ScrollView Dynamically Adding Text to TextView...

2009-05-25 Thread Derek Henderson

Alright, I'm majorly stumped here... All I am trying to do is make a
ScrollView scroll to the bottom of the TextView when the activity is
launched.

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent


ScrollView
android:id=@+id/currScroll
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=380px
android:background=#ff

TextView
android:id=@+id/currConversation
android:layout_width=fill_parent
android:layout_height=wrap_content
android:textColor=#00
android:background=#ff
android:textSize=18sp
/

/ScrollView

Button android:id=@+id/sendMessage
android:layout_column=0
android:layout_width=fill_parent
android:layout_height=wrap_content
android:text=@string/new_message
/

/LinearLayout

And here is the code...:

@Override
public void onResume() {
super.onResume();

ScrollView currScroll = (ScrollView) 
findViewById(R.id.currScroll);
currScroll.fling(-1);
Toast.makeText(this, Max:  + currScroll.getMaxScrollAmount(),
Toast.LENGTH_LONG).show();
}

The text is being added to currConversation dynamically in the
onCreate function using setText().The problem seems to be that no
matter how much text is in the TextView getMaxScrollAmount() always
returns 0.

I have tried scrollTo(), scrollBy(), fullScroll()!! Any help is
greatly appreciated!

--~--~-~--~~~---~--~~
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: conversion to dalvik format failed with error 1

2009-05-08 Thread Derek

I got this error frequently right after updating ADT.  Turned out that
I had updated my ADT instead of uninstall/install.  I had to manually
cleanse my eclipse install to get rid of references to 0.8


On May 8, 3:02 am, kenjkelly kenke...@kenkelly.com wrote:
 My guess is that the 1.5 release relies on something that gets built
 after it is needed. Thus the Clean fails but then it works on the next
 build.

 Can someone who worked on the Eclipse Plugin for 1.5 check that out?
 Incase it is important, I am using the 1.5 with Google libs
 selection.

 Ken Kelly

 On May 8, 3:34 am, Kamal Hasan kamal.hasa...@gmail.com wrote:

  Hi

  My project was running perfectly and when I cleaned the project then
  It started to give the following error.

  [2009-05-08 12:47:24 - MobilChek] no classfiles specified
  [2009-05-08 12:47:24 - MobilChek] Conversion to Dalvik format failed
  with error 1

  Pls help me in resolving this issue.

  Kamal

  On May 4, 2:53 am, Justin (Google Employee) j...@google.com wrote:

   Did you update your plugin? If so, did you create either a 1.1 AVD or
   a 1.5 w/Google Maps AVD?

   Cheers,
   Justin
   Android Team @ Google

   On May 2, 10:59 am, Berlin Brown berlin.br...@gmail.com wrote:

On May 2,1:05 pm, CnmJbm cnm...@gmail.com wrote:

 ok, it seems i fixed it on my environment.

 just delete the R.java (by refreshing the project) and rebuild the
 project.

 On May 2, 9:57 am, CnmJbm cnm...@gmail.com wrote:

  i got the sameerror, TOO!!!

  May Day

  On Apr 28, 3:57 pm, chris.cap...@gmail.com 
  chris.cap...@gmail.com
  wrote:

   Hi,

   I just updated to SDK 1.5 and all of my projects are failing to 
   build
   with the followingerror:

   [2009-04-28 15:53:23 - Utilities] no classfiles specified
   [2009-04-28 15:53:23 - Utilities]ConversiontoDalvikformatfailed
   witherror1

   (Utilities is the name of this specific project.)

   Any idea why? I'm on Ubuntu 9.04 x64. Before the update to 1.5
   everything worked fine. Thanks.

   Chris

I got rid of thaterrorand get thiserror, any ideas.  I have a
similar configuration:

[2009-05-02 14:22:39 - HelloWorld]Failedto find an AVD compatible
with target 'Android 1.1'. Launch aborted.- Hide quoted text -

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



[android-developers] Re: MapView showing as black screen after upgrade to 1.5

2009-05-02 Thread Derek

Thanks JP, looks like MyLocationOverlay.enableCompass() is the
culprit.  Commenting out that call is allowing the view to display.


On May 2, 1:02 am, JP joachim.pfeif...@gmail.com wrote:
 Check if your app might be stuck in your overridden
 MapActivity.onCreate().
 I had that problem and shuffle things in onCreate() around. Once
 onCreated() completes, the map showed as had been.

 On May 1, 10:19 pm, Derek dlawl...@gmail.com wrote:

  Has anyone seen their MapView which was working in 1.1 displaying a
  plain black screen (no errors) after compling with the 1.5 SDK?  I
  made sure to copy the debug.keystore from the 1.1 location to the new
  1.5 location so its compiling and loading on the phone correctly (I
  did a reinstall not uninstall/install) and shouldn't need a new
  mapsAPI key.

  No errors are showing up in DDMS other than:
  Failed to find provider info for com.google.settings

  Any ideas would be much appreciated!

  Thanks,
  Derek
--~--~-~--~~~---~--~~
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: Porting 1.0 to 1.5, map tiles stopped displaying

2009-05-01 Thread Derek

It looks like they moved the location of debug.keystore with SDK 1.5.
Since I'm on Vista, I had to copy my original debug.keystore from C:
\Users\me\AppData\Local\Android to C:\Users\me\.android


On May 1, 11:38 pm, JP joachim.pfeif...@gmail.com wrote:
 OK that was it. Busywork.

 Thanks again.

 On Apr 30, 3:48 pm, Ron ry...@mac.com wrote:

  I had to generate a new Google maps key using the new keystore in my
  project before the tiles would show.

  On Apr 29, 8:44 pm, JP joachim.pfeif...@gmail.com wrote:

   I started porting a functioning 1.0 app to 1.5 last night. It uses
   MapView and associated classes and everything checks out on 1.0. No
   such luck after taking it to 1.5. I've included maps API, the usual
   touch points (API key, Internet permission) are in place of course
   (coming from 1.0).
   I've created an id=3 AVD (Google Maps app works), and followed the
   porting instructions I found posted, but map tiles do not display
   after porting. Everything else, i.e. the overlaying functionality, is
   there. Nothing terrible shows in LogCat, so I am scratching my head
   what might be missing. Pointers welcome, THX in advance!
   JP
--~--~-~--~~~---~--~~
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] MapView showing as black screen after upgrade to 1.5

2009-05-01 Thread Derek

Has anyone seen their MapView which was working in 1.1 displaying a
plain black screen (no errors) after compling with the 1.5 SDK?  I
made sure to copy the debug.keystore from the 1.1 location to the new
1.5 location so its compiling and loading on the phone correctly (I
did a reinstall not uninstall/install) and shouldn't need a new
mapsAPI key.

No errors are showing up in DDMS other than:
Failed to find provider info for com.google.settings

Any ideas would be much appreciated!

Thanks,
Derek
--~--~-~--~~~---~--~~
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] Proper usage of object passing for TabActivity/TabHost

2009-04-25 Thread Derek

I'm working on a TabActivity with 4 tabs, each of which works on
various data pieces in a single data object.  I have a few questions:

- What is the best way to make this object available across all these
activities?  Is it as an object defined in the TabActivity and visible
to each of the children?
- How do you pass the result set by a child activity back through the
parent?  I'm always getting RESULT_CANCELED at the activity calling
the TabActivity regardless of what I set in the child activity.
- getLastNonConfigurationInstance() doesn't seem to work with these
child activities, is this expected?  When my child activity was a
standalone activity the code worked fine but now as a child it does
not.

Any help is appreciated.  There doesn't seem to be lots of good
information about TabActivity/TabHost out there anywhere.

Thanks,
Derek
--~--~-~--~~~---~--~~
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] Unzip file - Both regular and UTF-8 encoded

2009-04-22 Thread Derek

Hi all,

Just to let you know that we've implemented an unzip application that
workaround Android/Java limitations in java.util.zip package for
entries with non-ascii characters.
http://www.lysesoft.com/products/andexplorer/index.html

DK.

--~--~-~--~~~---~--~~
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] When to display/hide ZoomControls for ImageView

2009-04-17 Thread Derek

Hi,

I'm not sure when I should let the ZoomControls visible or invisible
for an ImageView. Is it correct to display it in ImageView's
onLongClick event, and hide it in onClick event?

Thanks,
Derek
--~--~-~--~~~---~--~~
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] reuse IDs?

2009-04-17 Thread Derek

Because there is no hierarchy in R.id, I presume an ID can be used in
many layout.xml files. Am I correct?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] content resolver to access Google Mail attachment

2009-04-17 Thread Derek

Hi,

I use managedQuery(getIntent().getData(), null, null, null, null) to
access the gmail attachment passed by Google Mail app. But the
returned cursor is null. getIntent().getFlags() returns 1, so the read
permission is properly assigned by Google Mail app. Is there any
setting I need to add in my application?

Thanks,
Derek
--~--~-~--~~~---~--~~
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 let an application as the default app of certain file type

2009-04-09 Thread Derek

Dianne, you are right. What I should say is that getIntent().getData()
returns null, even though the caller app uses intent.setData(). Any
idea why the data is not passed to the callee app?

On 8 Apr, 18:56, Dianne Hackborn hack...@android.com wrote:
 Um, getIntent() will never return null in onCreate().





 On Wed, Apr 8, 2009 at 10:44 AM, Derek xianguan...@gmail.com wrote:

  I called getIntent in both onCreate and onPostCreate, but both return
  null.

  below is my test code
  the caller
         Intent intent = new Intent(Intent.ACTION_VIEW);
         intent.setData(Uri.fromFile(new File(/sdcard/abc.doc)));
         //int.putExtra(Intent.EXTRA_TEXT, /sdcard/abc.doc); // tried
  this one as well
         intent.setType(application/msword);
         startActivity(intent);

  the callee's intent-filter
            intent-filter
                 action android:name=android.intent.action.VIEW /
                 category
  android:name=android.intent.category.DEFAULT /
                 data android:mimeType=application/msword/

             /intent-filter

  the callee app can pop up, but getIntent return null in onCreate an
  onPostCreate.

  any idea what's going wrong?

  On 8 Apr, 15:56, nEx.Software justin.shapc...@gmail.com wrote:
   This is how I get the filename:

   File f1 = new File(getIntent().getData().getPath());

   I don't know how to enumerate applications which can handle a certain
   type of file though.

   On Apr 7, 10:49 pm, Derek xianguan...@gmail.com wrote:

the other question is that if I'm develop an file explorer, how can I
know all the existing associations between file type (extensions) and
intents.- Hide quoted text -

   - Show quoted text -

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.- Hide quoted text -

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



[android-developers] Re: how to let an application as the default app of certain file type

2009-04-08 Thread Derek

I called getIntent in both onCreate and onPostCreate, but both return
null.

below is my test code
the caller
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.fromFile(new File(/sdcard/abc.doc)));
//int.putExtra(Intent.EXTRA_TEXT, /sdcard/abc.doc); // tried
this one as well
intent.setType(application/msword);
startActivity(intent);

the callee's intent-filter
   intent-filter
action android:name=android.intent.action.VIEW /
category
android:name=android.intent.category.DEFAULT /
data android:mimeType=application/msword/

/intent-filter


the callee app can pop up, but getIntent return null in onCreate an
onPostCreate.

any idea what's going wrong?


On 8 Apr, 15:56, nEx.Software justin.shapc...@gmail.com wrote:
 This is how I get the filename:

 File f1 = new File(getIntent().getData().getPath());

 I don't know how to enumerate applications which can handle a certain
 type of file though.

 On Apr 7, 10:49 pm, Derek xianguan...@gmail.com wrote:



  the other question is that if I'm develop an file explorer, how can I
  know all the existing associations between file type (extensions) and
  intents.- Hide quoted text -

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



  1   2   >