Re: [android-beginners] Re: Database handling - when do you open and close

2010-08-06 Thread Kostya Vasilyev
Sure. The service connection callback you seem to already have in your code.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

06.08.2010 12:10 пользователь Bender abende...@googlemail.com написал:

Ok I tried to find out at which point the service is started and when
I can access its database variable. The logs I used showed that the
services onCreate() is called after the onResume() method by my
activity. That is a bit late because I need access to the database
before onResume() to fill the views with data. Is there a way to tell
the activity to wait until the service is started?


On 5 Aug., 22:54, Kostya Vasilyev kmans...@gmail.com wrote:
 Starting / binding to a service is ...
 06.08.2010 0:49 пользователь Bender abende...@googlemail.com написал:



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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010.
For more information abo...

http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
and...

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Database handling - when do you open and close

2010-08-06 Thread Kostya Vasilyev

No, calling Thread.sleep() won't work.

Android framework is largely single-threaded, event-driven.

This means that your application and the framework run on the same 
thread, passing control to each other, doing work in small pieces. This 
thread is called the UI thread, and blocking it by calling sleep() can 
do only one thing - cause the Application Not Responding dialog to appear.


The right thing to do is call bindService, and return from onResume.

You've done your piece of work (responded to onResume, and requested 
that Android bind a service). Now you need to give Android a chance to 
do its piece of work - by returning from onResume into Android framework 
code, which will start the service (if necessary) and bind it, notifying 
your callback.


Then it's your turn again - once in the ServiceConnection callback, you 
know the service has been bound, and you can talk to the service and 
ultimately populate the UI.


So that's basically the scheme with services.

You might also want to look at ContentProviders. They have a few 
advantages over Services for this case - their lifecycle is managed by 
Android, access is synchronous (using ContentResolver), and they handle 
propagating data changes to existing queries / cursors (so if you have a 
ListView, its data will be live).


-- Kostya

06.08.2010 12:52, Bender пишет:

I tried the following in my activity:

 mServiceConnection =  new
DbServiceConnection(mDatabaseBinder);
 final Intent databaseServiceIntent = new Intent(this,
DatabaseService.class);
 this.bindService(databaseServiceIntent, mServiceConnection,
Context.BIND_AUTO_CREATE);

 while(mDatabaseBinder == null) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// catch...
}
 }

Did you mean that? Now it should wait until the mDatabaseBinder is set
which should be in the onServiceConnected() method but that code
results in an endless loop, mDatabaseBinder stays null. Maybe I got it
wrong how the components work together. As far as I understood it, you
have a service running in the background, which returns a binder in
onBind(). The service connection fills the binder
onServiceConnected() so it can be used in the activity to access the
services variables. Is that wrong?

On 6 Aug., 10:26, Kostya Vasilyevkmans...@gmail.com  wrote:
   

Sure. The service connection callback you seem to already have in your code.

--
Kostya Vasilyev --http://kmansoft.wordpress.com
 
   



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

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Database handling - when do you open and close

2010-08-05 Thread Kostya Vasilyev
Starting / binding to a service is asynchronous. You can't call bindService
and expect it to be already started and bound by the next line.

Call bindService and return control to Android by returning from onCreate or
whatever. Your service connection callback will be invoked a little later,
once the service is started.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

06.08.2010 0:49 пользователь Bender abende...@googlemail.com написал:

Thanks for your reply, and sorry for my late answer. :-)

I tried to get it running as a service but I don't really get how I
have to use services, binders and service connections. I'm reading a
book with an example for services but can't adopt it to my problem.
What I tried is the following:

I created one class for the service, which holds the variable for my
database:
__

public class DatabaseService extends Service {

   public DbAdapter mDbAdapter;
   private DatabaseBinder mDatabaseBinder = new DatabaseBinder();

   @Override
   public IBinder onBind(Intent intent) {
   return mDatabaseBinder;
   }

   @Override
   public void onCreate() {
   super.onCreate();
   mDatabaseBinder.mDatabaseService = this;
   mDbAdapter = new DbAdapter(getApplicationContext());
   mDbAdapter.open();
   }

   @Override
   public void onDestroy() {
   super.onDestroy();
   mDatabaseBinder.mDatabaseService = null;
   mDbAdapter.close();
   }

}

This is my database binder:
__

public class DatabaseBinder extends Binder {

   public DatabaseService mDatabaseService;

   public DbAdapter getDbAdapter() {
   return mDatabaseService.mDbAdapter;
   }

}

And this my service connection:
__

public class DbServiceConnection implements ServiceConnection {

   DatabaseBinder mBinder;

   public DbServiceConnection(DatabaseBinder binder) {
   mBinder = binder;
   }

   @Override
   public void onServiceConnected(ComponentName className, IBinder
binder) {
   mBinder = (DatabaseBinder) binder;
   }

   @Override
   public void onServiceDisconnected(ComponentName arg0) {
   }

}

If I want to use this in my activity with this:

   private DatabaseBinder mDatabaseBinder;
   private DbServiceConnection mServiceConnection = new
DbServiceConnection(mDatabaseBinder);

   final Intent databaseServiceIntent = new Intent(this,
DatabaseService.class);
   this.bindService(databaseServiceIntent, mServiceConnection,
Context.BIND_AUTO_CREATE);

   mDb = mDatabaseBinder.getDbAdapter();


I'm getting a nullpointer exception at the last line. I don't know if
I'm using it right (I guess not :D ), I haven't used services before.
Do you know why it is throwing a Nullpointer exception? Is this the
right way to use a service and bind it in the activity or should I do
it somehow different?


On 19 Jul., 00:30, brucko geoff.bruck...@gmail.com wrote:
 Bender,

 put your db in a local Se...
 http://developer.android.com/resources/samples/ApiDemos/src/com/examp...


 but DONT have your binder as a non-static inner class as in the
 example - or you will create a...
ATTENTION: Android-Beginners will be permanently disabled on August 9 2010.
For more information about this change, please read [http://goo.gl/xkfl] or
visit the Group home page.


Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged...

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Changing WiFi network login

2010-08-04 Thread Kostya Vasilyev

Then do it the same way web applications do.

Implement login functionality in your application, and you can check 
credentials. If the app has a web service-based backend, pass some kind 
of login token to the server can track usage.


-- Kostya

04.08.2010 1:09, Kevin Brooks пишет:
My original question was misleading. Let's forget the Android device 
for a moment. If a user logs into a computer, his credentials are 
checked on the network and he has access the Admin grants to him/her.


So without changing the whole Android System, I need a way to 
authenticate the user on the network through my application.



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

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] SecurityException in AccountManager.get(mContext).getPassword(account);

2010-08-04 Thread Kostya Vasilyev
Looks like Google has a special process that deals with account 
management. Only this process is allowed to get / set account passwords. 
It's probably also signed with a special key, which is checked by the 
kernel when it's started (guessing here).


If any application was allowed this, think how many web sites would be 
offering Google account passwords - 1,000 for $10.-, and 10,000 for 
$75.- (a 25% discount! only this month!)


-- Kostya

04.08.2010 12:26, parul пишет:

I'm trying to  retrieve the password of google account, but getting
security exception.
Also i have given permissions in androidManifest.xml to
account_manager, aunthenticator, get_account, manage account.

code :
=
android.accounts.Account[] googleAccount =
AccountManager.get(mContext).getAccounts();
for (android.accounts.Account account: googleAccount ) {
  String pwd = AccountManager.get(mContext).getPassword(account);
  AccountManager.get(mContext).setPassword(account, null);
}
=
Exception:
=
08-04 06:38:30.821: WARN/AccountManagerService(2248): caller uid 1000
is different than the authenticator's uid
08-04 06:38:30.821: INFO/parul(2804): exception thrown for account
manager try block
08-04 06:38:30.821: WARN/System.err(2804):
java.lang.SecurityException: caller uid 1000 is different than the
authenticator's uid
08-04 06:38:30.821: WARN/System.err(2804): at
android.os.Parcel.readException(Parcel.java:1218)
08-04 06:38:30.821: WARN/System.err(2804): at
android.os.Parcel.readException(Parcel.java:1206)
08-04 06:38:30.821: WARN/System.err(2804): at
android.accounts.IAccountManager$Stub
$Proxy.getPassword(IAccountManager.java:397)
08-04 06:38:30.821: WARN/System.err(2804): at
android.accounts.AccountManager.getPassword(AccountManager.java:157)
08-04 06:38:30.821: WARN/System.err(2804): at
com.samsung.mttwo.service.MtSmsHandler.handleMessage(MtSmsHandler.java:
421)
08-04 06:38:30.826: WARN/System.err(2804): at
com.samsung.mttwo.service.MtSmsHandler.handleMTSmsReceived(MtSmsHandler.java:
146)
08-04 06:38:30.826: WARN/System.err(2804): at
com.samsung.mttwo.service.MTSmsReceiver.onReceive(MTSmsReceiver.java:
30)
08-04 06:38:30.826: WARN/System.err(2804): at
android.app.ActivityThread.handleReceiver(ActivityThread.java:2637)
08-04 06:38:30.826: WARN/System.err(2804): at
android.app.ActivityThread.access$3100(ActivityThread.java:119)
08-04 06:38:30.826: WARN/System.err(2804): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
08-04 06:38:30.826: WARN/System.err(2804): at
android.os.Handler.dispatchMessage(Handler.java:99)
08-04 06:38:30.826: WARN/System.err(2804): at
android.os.Looper.loop(Looper.java:123)
08-04 06:38:30.826: WARN/System.err(2804): at
android.app.ActivityThread.main(ActivityThread.java:4363)
08-04 06:38:30.826: WARN/System.err(2804): at
java.lang.reflect.Method.invokeNative(Native Method)
08-04 06:38:30.826: WARN/System.err(2804): at
java.lang.reflect.Method.invoke(Method.java:521)
08-04 06:38:30.826: WARN/System.err(2804): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:862)
08-04 06:38:30.826: WARN/System.err(2804): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
08-04 06:38:30.826: WARN/System.err(2804): at
dalvik.system.NativeStart.main(Native Method)
=

If anybody is aware why i'm getting this problem plz help.
Thanks

   



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

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] ATTENTION: Android-Beginners will be permanently disabled on August 9 2010

2010-08-04 Thread Kostya Vasilyev
If there are so many regrets about the closing of this list isn't it
possible for anyone to create a mailing list with Google Groups? Let's call
it android-for-beginners or whatever. Anyone?

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

04.08.2010 20:39 пользователь Alessandro Pellizzari a...@amiran.it
написал:

Il giorno mar, 03/08/2010 alle 14.49 -0400, Mark Murphy ha scritto:


 For those who find StackOverflow to be ineffective, or find the
 behavior of volunteers there to...
The problem with Stackoverflow, IMVHO, is that it is a QA site, not a
discussion place. You ask something, someone replies. Hadrly I found
even a simple thread discussing different ways to do something.

Plus, I find it unusable for a casual visitor.  You visit it if you have
a question, search for it, maybe post a request.
But it is hard to browse through a topic, or just read some messages to
discover things you didn't even think where possible.

This list has the right amount of traffic for casual reading during work
pauses.
Android-developers is way too big (1000 messages a day? I end up marking
them all as read)

As for searching info, I prefer Google to Stackoverflow. This way I also
find blog posts, newsgroup posts, forums and this mailing list.


 There are other support resources as well (JavaRanch, anddev.org,
 etc.). I do not try to partic...
Too many, I agree, but this one was official, and was easily usable,
being a mailing list.
I would prefer a NNTP newsgroup, but a ml is good too.
A forum or a website? Not so...


 If this list is discontinued, for the near term, I will be focusing on
 StackOverflow and [andro...
I understand your position.
Thanks to you and the others who bothered to help us newbies.

I too will continue to read android-developers and see how it goes.
As for stackoverflow, maybe google will find it sometimes. :)

Bye.


--
Alessandro Pellizzari


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

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Eclipse lockups and crashes

2010-08-03 Thread Kostya Vasilyev
1.6 update 21 indeed has an issue with Eclipse, was discussed recently 
either here or on android-developers. Either roll back, or use search.


-- Kostya

03.08.2010 13:19, blindfold пишет:

I'm having the same problem with the latest r06 Android SDK and using
Java SDK 1.6.0_21 (C:\Program Files\Java\jdk1.6.0_21) and the latest
Eclipse updates on my Windows 7 64-bit system. It is a lot worse than
it was in the past (on the same PC) with older SDKs. I use Eclipse SDK
3.6.0, build id I20100608-0911. Perhaps Java SDK 1.6.0_21 is too new
but I did no further testing. It is indeed very annoying and I have to
be continuously prepared for Eclipse locking up.

Regards

On Aug 3, 2:33 am, -DC-diskcras...@gmail.com  wrote:
   

I'm using Eclipse (eclipse-java-galileo-SR2-win32) with ADT rev 6 and
have Java SDK 1.6.0_21 installed on my system. Eclipse locks up and/or
crashes on me regularly while coding. I've lost unsaved code and even
my Eclipse preferences before. It's maddening! Does anyone know what
might be causing this?

(I really wish Google would make an ADT plug-in for NetBeans...)
 
   



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

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Changing WiFi network login

2010-08-03 Thread Kostya Vasilyev
If the other side requires logging in, perhaps you could track usage
there?

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

04.08.2010 0:54 пользователь Kevin Brooks bear35...@gmail.com написал:

The real issue is logging into the network that is on the other side of that
Access Point.  I apologize for not making that clear before.



On Tue, Aug 3, 2010 at 2:21 PM, Mark Murphy mmur...@commonsware.com wrote:

 On Tue, Aug 3, 20...
-- 
Kevin
Proverbs 21:6



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

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: custom listview add button above listeview

2010-07-30 Thread Kostya Vasilyev

Declare the button in the activity's layout xml, above the ListView.

-- Kostya

30.07.2010 19:20, calmchess пишет:

I'm useing custom list view.which inflates the view..if you put a
button in the  XML it will put a button in each cell of the list view
i only want 1 button above the list view here is some more code to
make it clear.

public class customlistview extends Activity implements
OnClickListener{
ListView l1;
 private static class EfficientAdapter extends BaseAdapter  {
private LayoutInflater mInflater;
private ArrayListArrayListString  ret=null;

 public EfficientAdapter(Context context) {
  Sax sax1 = new Sax();
  try {
ret =  sax1.SaxIni();
} catch (Exception e) {

e.printStackTrace();
}


   mInflater = LayoutInflater.from(context);



  }

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Launching an About screen from Preferences

2010-07-30 Thread Kostya Vasilyev

Bret  Mark,

Sorry for interrupting, but I also got curious about this. It seems like 
a neat way to bring up the About box without making the context menu too 
large.


This works, no problems at all:

values/prefs.xml:

.
Preference android:key=aboutPref
android:title=About title
android:summary=About summary
intent android:action=ABOUT_ACTION/
/Preference
.

the manifest:

activity android:name=.AboutActivity 
android:label=@string/about_activity

android:theme=@android:style/Theme.Dialog
intent-filter
action android:name=ABOUT_ACTION/
category android:name=android.intent.category.DEFAULT /
/intent-filter
/activity

-- Kostya

30.07.2010 19:29, Bret Foreman пишет:

Mark,

Well, the manifest documentation is pretty sparse so it's not
surprising that it doesn't mention this case. A good example is the
screen of choices that face you when you look at the Application tab
in the manifest editor in Eclipse and click on one of the activities
or services. That calls up a form with about 25 choices, none of which
include an action, by the way. A document that describes what all
these choices mean would be very helpful. Note that there's a choice
called clear task on launch, a phrase that you can search in vain
for in the manifest documentation.

It seems like people mostly build projects by copy-paste from other
projects, which is a fine approach as far as it goes but it can grow
into a nightmare if people start propagating unsupported hacks. Then
you have hundreds of apps that break at the same time when a new
release invalidates the hack.

OK, down off my soapbox. The change you suggest below didn't work.
Same exception in logcat. I can think of several approaches to take it
from here:

1) I build a simple test project that illustrates the problem and
submit it as a bug.
2) We decide that this approach is unsupported, in which case I submit
a bug against the documentation.
3) We take another swing at it, recognizing that we are implementing
something that lives on shaky ground, since undocumented behavior can
change at any time.

What do you think?

Bret

On Jul 29, 7:02 pm, Mark Murphymmur...@commonsware.com  wrote:
   

I can't find where what you're doing is documented, so I have no idea
what the right behavior is. Do you have a link to where it describes
thisintent  child element ofPreference?

Regardless, I see where I went wrong before.

Your error is:

E/AndroidRuntime(  376): android.content.ActivityNotFoundException: No
Activity
found to handle Intent { act=com.shipmate.AboutShipMateActivity }

Notice the act=com.shipmate.AboutShipMateActivity part. That says
the Intent it is trying to use has an *action* of
com.shipmate.AboutShipMateActivity. So, add anintent-filter  with an
action  of com.shipmate.AboutShipMateActivity to your activity, and
you should have better luck.

 
   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Launching an About screen from Preferences

2010-07-30 Thread Kostya Vasilyev

Ditto - I was also about to suggest this.

Base Preference class is quite complete, it handles drawing the title 
and summary with proper fonts, and has an onClick() method.


Another way - instead of subclassing Preference, add a bit of code with 
setOnPreferenceClickListener.


-- Kostya

30.07.2010 21:36, Mark Murphy пишет:

That being said, if you keep a roster of things that might go 'boom'
in future releases for your apps, add this to the list, since for all
we know they'll dump this feature in favor of some other
implementation (e.g., dedicated IntentPreference class). In fact, if
you wanted to be super-safe, implementing an IntentPreference class
may not be that difficult, and you then aren't dependent on an
undocumented feature.
   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Launching an About screen from Preferences

2010-07-30 Thread Kostya Vasilyev


The key was having both action and category in the intent filter. Either 
one by itself didn't match the intent.


-- Kostya

30.07.2010 21:30, Mark Murphy пишет:

Yes, I think I barked up the wrong tree by suggesting to get rid of
the DEFAULT category. Glad to know this works!

On Fri, Jul 30, 2010 at 12:33 PM, Kostya Vasilyevkmans...@gmail.com  wrote:
   

Bret  Mark,

Sorry for interrupting, but I also got curious about this. It seems like a
neat way to bring up the About box without making the context menu too
large.

This works, no problems at all:

values/prefs.xml:

.
Preference android:key=aboutPref
android:title=About title
android:summary=About summary
intent android:action=ABOUT_ACTION/
/Preference
.

the manifest:

activity android:name=.AboutActivity
android:label=@string/about_activity
android:theme=@android:style/Theme.Dialog
intent-filter
action android:name=ABOUT_ACTION/
category android:name=android.intent.category.DEFAULT /
/intent-filter
/activity

-- Kostya

30.07.2010 19:29, Bret Foreman пишет:
 

Mark,

Well, the manifest documentation is pretty sparse so it's not
surprising that it doesn't mention this case. A good example is the
screen of choices that face you when you look at the Application tab
in the manifest editor in Eclipse and click on one of the activities
or services. That calls up a form with about 25 choices, none of which
include an action, by the way. A document that describes what all
these choices mean would be very helpful. Note that there's a choice
called clear task on launch, a phrase that you can search in vain
for in the manifest documentation.

It seems like people mostly build projects by copy-paste from other
projects, which is a fine approach as far as it goes but it can grow
into a nightmare if people start propagating unsupported hacks. Then
you have hundreds of apps that break at the same time when a new
release invalidates the hack.

OK, down off my soapbox. The change you suggest below didn't work.
Same exception in logcat. I can think of several approaches to take it
from here:

1) I build a simple test project that illustrates the problem and
submit it as a bug.
2) We decide that this approach is unsupported, in which case I submit
a bug against the documentation.
3) We take another swing at it, recognizing that we are implementing
something that lives on shaky ground, since undocumented behavior can
change at any time.

What do you think?

Bret

On Jul 29, 7:02 pm, Mark Murphymmur...@commonsware.comwrote:

   

I can't find where what you're doing is documented, so I have no idea
what the right behavior is. Do you have a link to where it describes
thisintentchild element ofPreference?

Regardless, I see where I went wrong before.

Your error is:

E/AndroidRuntime(  376): android.content.ActivityNotFoundException: No
Activity
found to handle Intent { act=com.shipmate.AboutShipMateActivity }

Notice the act=com.shipmate.AboutShipMateActivity part. That says
the Intent it is trying to use has an *action* of
com.shipmate.AboutShipMateActivity. So, add anintent-filterwith an
actionof com.shipmate.AboutShipMateActivity to your activity, and
you should have better luck.


 


   


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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

 



   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Loading images in android

2010-07-28 Thread Kostya Vasilyev
The code below replaces the activity's content view (the root of view 
hierarchy) with a new LinearLayout.


If you want to keep your existing layout around, do this:

1 - declare a LinearLayout placeholder in your layout xml file, give it 
an ID.


2 - instead of creating a new LinearLayout, get it by calling findViewById.

3 - don't call setContentView

-- Kostya

28.07.2010 8:13, ethan пишет:

This is the code that i used :

LinearLayout mLinearLayout;
mLinearLayout = new LinearLayout(this);

ImageView i = new ImageView(this);
 i.setImageResource(R.drawable.cow_icon);
 i.setAdjustViewBounds(true); // set the ImageView bounds to match
the Drawable's dimensions
 i.setLayoutParams(new
Gallery.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));

 //Add the ImageView to the layout and set the layout as the
content view
 mLinearLayout.addView(i);
 setContentView(mLinearLayout);


With this code, i can see the image getting didplayed but it goes on a
different layout. It doesnt display on the current layout.
Is there a way i can display this in the current layout ?


On Jul 27, 12:18 pm, Kostya Vasilyevkmans...@gmail.com  wrote:
   

You could use one image view and several different images with varying
number of flowers.

Or create the required number of image views from code, all using the same
image.

Or declare four image views in your layout and manage their visibility from
code.

--
Kostya Vasilyev --http://kmansoft.wordpress.com

27.07.2010 21:11 пользователь ethanpuripun...@gmail.com  написал:

Ok. So in this case, is there a way to dynamically create imageviews
from the code (not xml) based on number of images to display ?
Or should i just statically create 4 imageviews and only populate them
based on the number of flowers i want to display ?

On Jul 27, 10:52 am, Justin Andersonjanderson@gmail.com  wrote:

 

No... displaying the number...
On Tue, Jul 27, 2010 at 8:25 AM, ethanpuripun...@gmail.com  wrote:
   

You are correct.
 
 

In...
android-beginners%252bunsubscr...@googlegroups.comandroid-beginners%25252bunsubscr...@googlegroups.com
 

android-beginners%25252bunsubscr...@googlegroups.comandroid-beginners%2525252bunsubscr...@googlegroups.com



 

For more options, visit this group at
http://groups.google.com/group/androi...
 
   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Build.BOOTLOADER / Build.RADIO

2010-07-28 Thread Kostya Vasilyev

Those fields are new with Android 2.2.

Are you sure you're compiling against Android 2.2?

-- Kostya

28.07.2010 2:38, Doward пишет:

According to the SDK we should be able to read the bootloader and
radio versions, but Eclipse is freaking out about it.

I can read any other Build.whatever  fine.

Any idea?

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Changes required to handle dual orientations

2010-07-27 Thread Kostya Vasilyev

Ah.

Was this a home screen widget?

27.07.2010 0:47, Bret Foreman пишет:

Found the problem. I should have learned my lesson by now. When you do
any substantial resource changes, you have to uninstall the app from
all your targets or you end up with a toxic mix of old and new
resources info. Problem solved.

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] What is drawable-hdpi, drawable-ldpi and drawable-mdpi ?

2010-07-27 Thread Kostya Vasilyev

Shaista,

drawable is the default. If a higher or lower resolution image is 
needed, depending on the screen, Android can scale it as appropriate.


However, this automatic scaling doesn't always look that great. In those 
cases, you, as the developer, can provide alternate versions of the 
same resource in appropriate folders. They will override automatically 
scaled resources from drawable as appropriate based on the resource 
directory name (i.e. hdpi for high-density screens, etc.).


This gives you fine grained control: some drawables can be scaled 
automatically (if this scaling looks good to you), and others can have 
alternate (high-res or low- res) versions.


-- Kostya

27.07.2010 13:51, Shaista Naaz ?:


Thanks for this, but I have a confusion that say I need to put one 
image into the drawable folder to run it in eclipse, where should i 
keep it, I mean in which folder or should I keep it in all the three?


Thanks,
Shaista Naaz

On Tue, Jul 27, 2010 at 3:08 PM, YuviDroid yuvidr...@gmail.com 
mailto:yuvidr...@gmail.com wrote:


http://developer.android.com/guide/practices/screens_support.html

On Tue, Jul 27, 2010 at 11:35 AM, Shaista Naaz
shaistanaa...@gmail.com mailto:shaistanaa...@gmail.com wrote:

Why it is that whenever I select the SDK target other than
Android 1.1 for a new project. I get 3 folders instead of one
folder for drawable inside res.
And that is drawable-hdpi, drawable-ldpi and drawable-mdpi.

Please kindly comment.

Thanks,
Shaista
-- 
You received this message because you are subscribed to the Google

Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
mailto:android-beginners%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en




-- 
YuviDroid

Check out Launch-X http://android.yuvalsharon.net/launchx.php (a
widget to quickly access your favorite apps and contacts!)
http://android.yuvalsharon.net

-- 
You received this message because you are subscribed to the Google

Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
mailto:android-beginners%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Loading images in android

2010-07-27 Thread Kostya Vasilyev
You could use one image view and several different images with varying
number of flowers.

Or create the required number of image views from code, all using the same
image.

Or declare four image views in your layout and manage their visibility from
code.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

27.07.2010 21:11 пользователь ethan puripun...@gmail.com написал:

Ok. So in this case, is there a way to dynamically create imageviews
from the code (not xml) based on number of images to display ?
Or should i just statically create 4 imageviews and only populate them
based on the number of flowers i want to display ?


On Jul 27, 10:52 am, Justin Anderson janderson@gmail.com wrote:
 No... displaying the number...

 On Tue, Jul 27, 2010 at 8:25 AM, ethan puripun...@gmail.com wrote:
  You are correct.

  In...
  android-beginners%252bunsubscr...@googlegroups.comandroid-beginners%25252bunsubscr...@googlegroups.com
android-beginners%25252bunsubscr...@googlegroups.comandroid-beginners%2525252bunsubscr...@googlegroups.com



  For more options, visit this group at
 http://groups.google.com/group/androi...

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Notepadv2

2010-07-26 Thread Kostya Vasilyev

Sam,

According to docs:

http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html

match_parent is introduced in API version 8, that is, Android 2.2

Your project is probably set up to compile against an earlier version of 
Android. If that is the case, use layout_xxx=fill_parent, not 
match_parent.


-- Kostya

26.07.2010 19:49, Sam Hobbs пишет:
I am getting errors from the Notepadv2 sample in the tutorials. If the 
problem is that I made a mistake, then I will try to figure it out but 
I really think I followed instructions. The tutorial is at:


http://developer.android.com/resources/tutorials/notepad/index.html

The Notepadv1 works for me, but Notepadv2 gets the errors below. All I 
did was to create the project from the Notepadv2 source without 
modifying anything. The gen folder is empty so I assume I can ignore 
the errors about R.



Description Resource Path Location Type
error: Error: String types not allowed (at 'layout_height' with value 
'match_parent'). note_edit.xml /Notepadv2/res/layout line 3 Android 
AAPT Problem
error: Error: String types not allowed (at 'layout_height' with value 
'match_parent'). note_edit.xml /Notepadv2/res/layout line 3 Android 
AAPT Problem
error: Error: String types not allowed (at 'layout_width' with value 
'match_parent'). note_edit.xml /Notepadv2/res/layout line 3 Android 
AAPT Problem
error: Error: String types not allowed (at 'layout_width' with value 
'match_parent'). note_edit.xml /Notepadv2/res/layout line 3 Android 
AAPT Problem
error: Error: String types not allowed (at 'layout_width' with value 
'match_parent'). note_edit.xml /Notepadv2/res/layout line 7 Android 
AAPT Problem
error: Error: String types not allowed (at 'layout_width' with value 
'match_parent'). note_edit.xml /Notepadv2/res/layout line 7 Android 
AAPT Problem
error: Error: String types not allowed (at 'layout_width' with value 
'match_parent'). note_edit.xml /Notepadv2/res/layout line 23 Android 
AAPT Problem
R cannot be resolved Notepadv2.java 
/Notepadv2/src/com/android/demo/notepad2 line 45 Java Problem
R cannot be resolved Notepadv2.java 
/Notepadv2/src/com/android/demo/notepad2 line 60 Java Problem
R cannot be resolved Notepadv2.java 
/Notepadv2/src/com/android/demo/notepad2 line 64 Java Problem
R cannot be resolved Notepadv2.java 
/Notepadv2/src/com/android/demo/notepad2 line 71 Java Problem




The following is at line 3 of note_edit.xml.

LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
android:orientation=vertical android:layout_width=match_parent
android:layout_height=match_parent




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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Changes required to handle dual orientations

2010-07-26 Thread Kostya Vasilyev

Bret,

You use the same layout XML file names and same widget IDs in both files 
- that way, orientation changes (and other alternate resources) are 
completely transparent to the application code.


But it's res/layout-land, not res/layout/land.

More info here:

http://developer.android.com/guide/topics/resources/providing-resources.html#QualifierRules

-- Kostya

26.07.2010 20:42, Bret Foreman пишет:

My UI designer has created both a portrait and landscape version of
one of our screens. These have the same IDs for all the widgets but a
different layout as appropriate. One layout is in res/layout and the
other is in res/layout/land. I loaded her res files as described and
now I see a runtime exception when the orientation changes from
portrait to landscape. I guess this is due to either 1) We need
different resource IDs for the two different orientations or 2) I need
some changes in the manifest to tell Android that I'm using res/layout
in one orientation and res/layout/land in the other for that activity.
Can someone point me in the right direction to fix this up?

Thanks

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Changes required to handle dual orientations

2010-07-26 Thread Kostya Vasilyev

Something's got to be different.

Open R.java and scan for your view id there, check to see if maybe you 
have a close sounding ID, or there is a capitalization difference.


-- Kostya

26.07.2010 21:05, Bret Foreman пишет:

I mistyped. The file path is actually res/layout-land. The exception
is happening when I call findViewById for one particular button. I
stared at the two xml files as carefully as I could and the ID of that
button is identical in both files. Other buttons are not causing any
trouble. To add to the frustration, the logcat does not show the
exception, though the system does a Force-Close at the exact point of
calling findViewById for that button in the debugger.

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Changes required to handle dual orientations

2010-07-26 Thread Kostya Vasilyev

Bret,

Is there really a line break in the failing case? I mean between @+id/ 
and ViewEvents?


26.07.2010 21:17, Bret Foreman пишет:

Here's a little more detail from layout-land (fails) and layout
(works) respectivley. The fist button causes a runtime exception in
findViewById, the second works:

FAILS
Button android:layout_height=wrap_content android:id=@+id/
ViewEvents android:text=View Events
android:layout_width=wrap_content android:layout_gravity=center/
Button

WORKS
Button android:layout_width=wrap_content
android:layout_height=wrap_content android:id=@+id/ViewEvents
android:text=View Events/Button

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Unable to deploy apps to AVD using Eclipse

2010-07-26 Thread Kostya Vasilyev
Data Execution Protection is not unique to 64 bit.

First appeared in XP, I believe.

In fact, I have it enabled (at default level) and having no problems with
the emulator.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

26.07.2010 23:40 пользователь DanH danhi...@ieee.org написал:

Also, I have run Eclipse under Administrator role which in turn will
invoke any process as trusted
Norton seems to mistrust Administrator stuff more than ordinary user
stuff.

Note that a lot of things (like Data Execution Protection) appear to
be unique to the 64-bit version of Windoze, so folks with 32-bit
machines will have no problem.


On Jul 26, 1:10 pm, Abduaziz Hasan affa...@gmail.com wrote:
 @Sam

 Thank you for your support...
 2010/7/26 Kostya Vasilyev kmans...@gmail.com


  No problems with NOD32 here either.

  Running Windows 7 64bit.

  --
  Kostya Vasilye...
  26.07.2010 1:10 пользователь Sam Hobbs s...@samhobbs.org написал:


  Many people have had problems with Norton. It was pre-installed in my
  system but I cleared...
  android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
android-beginners%2bunsubscr...@googlegroups.comandroid-beginners%252bunsubscr...@googlegroups.com


  For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en
...

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Changes required to handle dual orientations

2010-07-26 Thread Kostya Vasilyev
Hmm.

Looks good.

What I would do at this point is gradually rebuild the layouts bottom up,
starting with the problem view, and assigning new id tokens.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

26.07.2010 23:27 пользователь Bret Foreman bret.fore...@gmail.com
написал:

No, no line break. That's just an artifact of the cut and paste.


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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Changes required to handle dual orientations

2010-07-26 Thread Kostya Vasilyev
Also, try removing layout_gravity. Shouldn't matter, but that's the only
difference I am able to see.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

26.07.2010 23:27 пользователь Bret Foreman bret.fore...@gmail.com
написал:

No, no line break. That's just an artifact of the cut and paste.


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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Unable to deploy apps to AVD using Eclipse

2010-07-25 Thread Kostya Vasilyev

Abduaziz,

Does your Windows home directory have non-English characters? 
(C:\Users\your name)?


I found that in this case (mine has Russian characters), the emulator 
has various problems. I use the command line to create the emulator in 
some other directory that has only English characters (e.g. android 
create avd -p D:\Android\emulators\avd_1.6_qvga).


-- Kostya

25.07.2010 1:24, Abduaziz Hasan ?:

Dear DanH

Thank you for your reply.

When I first started my AVD I waited for some time until it was 
initialzed and I was at the home screen. The problem is that my app 
didn't deploy as I did the same on Ubuntu and it started the once the 
AVD was initialized.


As for the second comment, it actually popped up once the AVD started 
under Ubuntu but not Windows. So this might be a Windows case.


Thanx and regards,

On Sat, Jul 24, 2010 at 11:26 PM, DanH danhi...@ieee.org 
mailto:danhi...@ieee.org wrote:


First off, the first time you start an AVD after creating it you have
to wait a VERY LONG TIME for it to configure itself completely.

Secondly, I have found that, contrary to the docs, the application
does not pop up of its own accord once loaded, but instead you have
to press the Menu (I think) button.  This may be something peculiar to
my config, but I suspect it's dependent on the particular AVD you
choose.

On Jul 24, 1:35 pm, Abduaziz Hasan affa...@gmail.com
mailto:affa...@gmail.com wrote:
 Hi all,

 I am new to Android development and have a very long experience
in Java
 technology development. When trying to develop for Android,
using Eclipse
 and Android SDK, I have had a problems with deploying the apps, or
 simulating them, using the AVD. The problem is when I run the
application,
 through Eclipse, the AVD device booted normally but my
applications don't
 get deploy.

 I have tried to solve it by changing almost everything in the run
 configuration and the Android preference. I even deleted the
Android SDK and
 installed it again but with no use.

 My environment setup is:
 - Windows 7
 - Eclipse Helios
 - Android sdk r06
 - Android plugin for Eclipse 0.9.7.v201

 Now I have tried the same setup on Ubuntu 10.04 and it is
working fine.

 Anyone had a similar problem?

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
mailto:android-beginners%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Unable to deploy apps to AVD using Eclipse

2010-07-25 Thread Kostya Vasilyev

25.07.2010 13:01, Abduaziz Hasan пишет:



BTW, can this be related to Windows 7? I mean is there anyone who is 
using Windows 7 and not having the problem?
Yes, I don't any problems with the emulator on Windows 7. Maybe there 
are others :)


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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Unable to deploy apps to AVD using Eclipse

2010-07-25 Thread Kostya Vasilyev
Maybe...

Why don't you try creating a new AVD using the command line, and make sure
there are no spaces or non-english characters in its pathname?

Also, do you run an antivirus? I use NOD32 and don't have any issues with
it. Just for test purposes, you could try disabling yours.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

25.07.2010 18:42 пользователь Abduaziz Hasan affa...@gmail.com написал:

One note:


I am trying to deploy the app using the adb install  command but I noticed
that the adb didn't find the avd device that I created using eclipse. I
tried to list the devices registered using adb devices but no device was
found although I have one my_avd.

Might this be the cause of the problem??





On Sun, Jul 25, 2010 at 5:24 PM, Abduaziz Hasan affa...@gmail.com wrote:

 My path doesn't e...

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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Unable to release partial wake lock in service

2010-07-25 Thread Kostya Vasilyev
Wake locks have to do with CPU state, not with service lifecycle. If you
don't need the service at some point, call stopself or stopservice.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

25.07.2010 19:52 пользователь Bret Foreman bret.fore...@gmail.com
написал:

Well, my understanding from the docs is that once a service has the
wake lock cleared and no other services or activities are bound to it
then it should be destroyed in a short time. But it's only a small
change to my application logic to explicitly have the service call its
stopSelf when the main application exits.

--

You received this message because you are subscribed to the Google
Groups Android Beginners group

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Creating a listview in for an android home screen widgets

2010-07-25 Thread Kostya Vasilyev
Sure. Add one or more (repeating) views, make a couple buttons for scrolling
to previous/next positions, and update data item views when these buttons
are clicked.

Press and drag is reserved for home screen switching, anyway.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

25.07.2010 22:30 пользователь Rodney Lendore rodney.lend...@gmail.com
написал:

So is there another way to create a scrollable List in a widget ? I thinking
along the lines of the HTC Calender widget in which you can scroll through
all your events for the month etc.

Thanks


On Sun, Jul 25, 2010 at 6:23 PM, Justin Anderson janderson@gmail.com
wrote:

 That is corre...

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Unable to deploy apps to AVD using Eclipse

2010-07-25 Thread Kostya Vasilyev
No problems with NOD32 here either.

Running Windows 7 64bit.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

26.07.2010 1:10 пользователь Sam Hobbs s...@samhobbs.org написал:

Many people have had problems with Norton. It was pre-installed in my system
but I cleared it out of my system and installed Microsoft Security
Essentials, which is free. I am not recommending anything except to say that
I have had no problems that I am aware of related to AV software and I have
not modified the installation of the AV software for Eclipse or the Android
emulator or whatever.

In my previous system, I used avast and I used various virtual systems and I
had no problem with avast.




DanH wrote:

 BTW, I'm using Norton Internet Security.  I've turned off Insight,
 Antispy...

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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Windows 7 issue? gen [in HelloAndroid] does not exist

2010-07-23 Thread Kostya Vasilyev

FWIW - the following combo works for me:

- JDK 6 update 20 - 32 bit
- Eclipse for Java, Galileo SR2 - win32
- Windows 7 64-bit

-- Kostya

23.07.2010 21:07, Anil пишет:

I installed Java 1.6.20 which avoids the Eclipse problem.
Did you get it working for 64 bit Windows? I didn't see an update on
your thread (http://groups.google.com/group/android-beginners/
browse_thread/thread/6cde21db2a09cacd/
26e26503c3b85a94#26e26503c3b85a94)
For now, I am using my laptop with Vista 32 bit.

On Jul 22, 2:26 pm, Sam Hobbss...@samhobbs.org  wrote:
   

Did you look at previous messages in this group for answers? I don't see
mention of it. My message just has a link to the sticky in the Eclipse
forums; did you look there?

There is a problem causing problems for Eclipse 3.5 in Windows; I don't
know if it causes the problem you are asking about, but it is worth
looking at.



Anil wrote:
 

I have been trying to get it up and running on Windows 7 but have had
issues.
Running Hello Android fails. Yes, I build, clean, build.
Java 1.6.20, Eclipse 3.5.2, Windows 7 (it is 64 bit but I installed
the 32 bit Java and 32 bit Eclipse).
Error Log:
   
 

!ENTRY org.eclipse.jdt.ui 4 10001 2010-07-22 09:16:32.010
!MESSAGE Internal Error
!STACK 1
Java Model Exception: Java Model Status [gen [in HelloAndroid] does
not exist]
at
org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:
502)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:
246)
at
org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:
515)
at
org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:
252)
at
org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:
238)
at
org.eclipse.jdt.internal.core.PackageFragmentRoot.getKind(PackageFragmentRoot.java:
477)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:
645)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.handleAffectedChildren(PackageExplorerContentProvider.java:
791)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:
734)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.handleAffectedChildren(PackageExplorerContentProvider.java:
791)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:
734)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.elementChanged(PackageExplorerContentProvider.java:
124)
at org.eclipse.jdt.internal.core.DeltaProcessor
$3.run(DeltaProcessor.java:1557)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:
1547)
at
org.eclipse.jdt.internal.core.DeltaProcessor.firePostChangeDelta(DeltaProcessor.java:
1381)
at
org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:
1357)
at
org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:
1958)
at
org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:
470)
at org.eclipse.core.internal.events.NotificationManager
$2.run(NotificationManager.java:291)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:
285)
at
org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:
149)
at
org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:
313)
at
org.eclipse.core.internal.resources.Workspace.aboutToBuild(Workspace.java:
244)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:
513)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:
1800)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:
1782)
at
org.eclipse.core.internal.resources.Project.internalBuild(Project.java:
502)
at org.eclipse.core.internal.resources.Project.build(Project.java:94)
at
org.eclipse.ui.internal.ide.dialogs.CleanDialog.doClean(CleanDialog.java:
312)
at org.eclipse.ui.internal.ide.dialogs.CleanDialog
$1.runInWorkspace(CleanDialog.java:154)
at
org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:
38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!SUBENTRY 1 org.eclipse.jdt.core 4 969 2010-07-22 09:16:32.010
!MESSAGE gen [in HelloAndroid] does not exist
   

--
Sam Hobbs
Los Angeles, CA
 
   



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

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

NEW! Try asking and tagging your question on Stack 

Re: [android-beginners] [Ask] Android Laptop + need to run Win XP apps

2010-07-23 Thread Kostya Vasilyev
Try virtualbox.org

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

24.07.2010 0:31 пользователь Umar ramu.i...@gmail.com написал:

Executive Summary:

* Unable to cross the chasm between Windows 7 to Windows XP, driven by
a business need. (see thread below for details) {what is means for me?
Answer: Think Android :-)}
* Exploring whether the following innovation exists:
   * Laptop running Android OS.
   * Android software that supports, via virtualization, running
Windows XP apps (Outlook, MS Office) [read: not Win 7 apps] as well as
Win XP-based VPN client to connect to a corporate environment that
still is running Win XP. Note that I am needing this type of usecase
for demo purposes but rather to do my work and earn a living
(without having to downgrade to a laptop running Win XP).
* Have a passion for drinking the Android coolade (rather than just
using it on a smartphone).

--original thread that started in Win*land that never got
a meaningful response*-

[Ask] VPN connection to Windows XP environment (without blue
screening)
I have a laptop running Windows 7. I need to connect and use my laptop
(running Windows 7) in an IT environment which is still running
Windows XP SP2.

I have had some issues with running a Windows XP-based VPN client on
my Windows 7 laptop, resulting in a blue screen.

I'd like to figure out whether VMWare (or other) has a product that
will enable me to do the following:

* Establish a Windows XP virtualized environment on my Windows 7
laptop (64 bit).
* Note that I don't have a Windows XP license on my laptop (only a
Windows 7 license).
* Securely connect using Cisco VPN client to an IT environment that is
still running Windows XP SP2.
* Need to make sure that my Windows 7 laptop is unimpacted (i.e., does
not blue screen) by any Windows XP application that I launch within
the virtualized environment.
* My Dell-based laptop (Latitude, D620) is a 64-bit architecture
running Win 7 Enterprise.
* Need to achieve secure (VPN-based) access to Win XP environment in a
corporate setting.
* Not for demo purposes where I am playing with multiple OS'es.
* Will also need to use Win XP version of Outlook and run MS Office
apps within virtualized Win XP environment.
* Is there a way to leverage MS Office 2007 version of the apps
installed in Win 7 (within the Win XP environment)?

Can a business user (who is not technically savvy) install the product
(assuming one exists)? What is the cost of the product?

Thanks for any feedback.

Long Story Short: This question is still in discussion mode and
resolved as a parking lot issue in Win*land. The poor user (me) is
not exactly a happy camper. Can Android come to the rescue?



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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Force close issue!

2010-07-21 Thread Kostya Vasilyev
At this point, let the application run until you get a force close 
dialog on the device.


Then check logcat (in Eclipse or adb logcat from the command line) to 
find out the cause - it will be in the stack trace, under Caused by:.


The message about JAR means that the crash is somewhere inside Android - 
possibly you are passing a null pointer to some method, or forgot to 
declare something in the manifest. This is nothing to be especially 
concerned about - check logcat and eliminate the cause.


-- Kostya

21.07.2010 10:13, Linh Le пишет:

I am having problems right when I run the program. Whenever I use the
original file, it runs fine. However, for the file I made edits too,
it always sees to force close itself. I ran it through a debugger and
this is what I get:


The JAR of this class file belongs to container 'Android 2.1' which
does not allow modification to source attachments on its entries

//Compiled from Resources.java (version 1.5: 49.0, super bit)

Does anybody know what is wrong with it when it is running?

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Returning values from dialog

2010-07-20 Thread Kostya Vasilyev
Try removing 'final' from 'final mytitle'.

'final' in Java means you are telling the compiler you are going to assign
the value once, a kind of self-check. Consequent assingments are flagged as
an error.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

20.07.2010 18:26 пользователь nimusi nimus...@gmail.com написал:

I am a newbie trying to learn Java at the same time as learning
Android.

I need to show a dialog containing two EditTexts and return the
values:

I am using the following code:

public static String addItem(final Context context) {
   final String myTitle = ;

   final Dialog myDialog = new Dialog(context);
   Window window = myDialog.getWindow();
   window.setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
   myDialog.setTitle(Add Item);
   myDialog.setContentView(R.layout.additem);
   final EditText txtTitle =
(EditText)myDialog.findViewById(R.id.txtTitle);
   final EditText txtNote =
(EditText)myDialog.findViewById(R.id.txtNote);
   Button btnOK =
(Button)myDialog.findViewById(R.id.btnAddItem);
   Button btnCancel =
(Button)myDialog.findViewById(R.id.btnCancelAddItem);
   btnOK.setOnClickListener(new View.OnClickListener() {
   @Override
   public void onClick(View v) {
   String thisTitle =
txtTitle.getText().toString();
   String thisNote =
txtNote.getText().toString();
   if (thisTitle.length() == 0) {
   Toast.makeText(context, Title is
blank!,
Toast.LENGTH_LONG).show();
   return;
   }
   if (thisNote.length() == 0) {
   Toast.makeText(context, Note cannot
be blank,
Toast.LENGTH_LONG).show();
   return;
   }
   myDialog.dismiss();
   myTitle = thisTitle + --- + thisNote;
  error here
   }
   });
   btnCancel.setOnClickListener(new View.OnClickListener() {
   @Override
   public void onClick(View v) {
   myDialog.dismiss();
   }
   });
   myDialog.show();
   return myTitle;
   }

Within the Click handler for the button I get the error 'the final
local variable myTitle cannot be assigned, since it is defined in an
emclosing type.  I would be grateful for any help with this.


Nimusi

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Including libraries in project

2010-07-17 Thread Kostya Vasilyev
During compilation, Android tools use standard Java .class format, as 
you found out.


However, during application packaging (I think) they are converted into 
Dalvik's special format, .dex, which does not use Sun's Java bytecode.


If you list the contents of an .apk file, you will see one .dex file 
instead of multiple .class files, as would be the case with a regular 
Java application.


http://en.wikipedia.org/wiki/Dalvik_(software)

-- Kostya

17.07.2010 17:06, DanH пишет:

That's not been my impression, and when I browse an Android class file
with a hex editor it says CAFEBABE.

On Jul 16, 11:48 pm, kypriakosdemet...@ece.neu.edu  wrote:
   

So it is fair to say = Android bytecode != 3rd party code bytecode
(particularly
from IBM or SUN or Axis)? So the reason I am not seeing the libraries
(which
otherwise helped me compile my imported app in Eclipse) in the apk
file
is because they are not recognized by the Android platform? Unless I
obtain
the source code for all those libs and try to compile and fix the
millions of
errors that will probably appear, I won't be able to use them? Is that
a fair
statement? Oh o ...

Thanks

On Jul 16, 4:31 pm, kypriakosdemet...@ece.neu.edu  wrote:

 

Hi all,
   
 

I managed to compile the imported application (the trick was not to
just
throw the lib directory in the project but to also build a library out
of  the
jars and present that in the project class path). However, I am
noticing
in DDMS (and in debug perspective) when I launch the app that one of
the
threads quits and complains that:
Failed resolving Lcom/myApp/PeerToPeerAdapter: interface 211 Lnet/
wlib/PeerGen.
   
 

I can see the net/lib/PeerGen in the jar files included in the library
that
is in the classpath. Afterall it compiles fine. Why does it complain
at runtime? Doesn't the Android plugin package what it needs in the
dex,
apk and res_ files before it deploys the app in the emulator?
I could not find anything on this in the resources so I am wondering
if
anyone had this issue before - It could be trivial and I am missing
something
very obvious.
   
 

Thanks
   
   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] The Force Close Error is suddenly back...

2010-07-16 Thread Kostya Vasilyev

Victoria,

The cause of this exception appears in logcat:

07-16 19:40:45.124: ERROR/AndroidRuntime(225): Caused by:
java.lang.NullPointerException
07-16 19:40:45.124: ERROR/AndroidRuntime(225): at
com.mobilevideoeditor.moved.EditGalleryView
$VideoAdapter.getCount(EditGalleryView.java:73)

Looks like vidUris is null.

Set a breakpoint and debug - looks like adapter's getCount() gets called 
before the information (vidUris) becomes available.


-- Kostya

17.07.2010 0:49, Victoria пишет:

Hi,

I am trying to load videos from my emulated sdcard into my implemented
GridView, it worked fine before, when I used the GridView example from
Google...but now I get a Force close error when I try to open the app.

The entire app works (or rather should work) like this a TabView is
launched that includes 2 tabs (GalleryView.java and main.xml), each
tab loads a GridView (EditGalleryView.java and ShareGalleryView.java).
Before I tried loading videos into the gridView I simply used the
GridView example as starting point. Now on basis of this example I am
trying to load videos into my GridView from the sdcard, which
apparently seems to cause a Force Close Error.

If someone could help me find the problem that's causing this, it
would be great because I really don't know what's wrong now ...
Thanks in Advance

Here is the code I use:

The Manifest.xml:
?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
   package=com.mobilevideoeditor.moved
   android:versionCode=1
   android:versionName=1.0
 application android:icon=@drawable/icon android:label=@string/
app_name
activity android:name=.EditGalleryView
 android:label=@string/app_name
 android:theme=@android:style/
Theme.NoTitleBar
 intent-filter
 action android:name=android.intent.action.PICK/
   
 

 /intent-filter
  /activity
activity android:name=.ShareGalleryView
 android:label=@string/app_name
 android:theme=@android:style/
Theme.NoTitleBar
 intent-filter
 action
android:name=android.intent.action.SEND/
 /intent-filter
 /activity
activity android:name=.GalleryView
 android:label=@string/app_name
 android:theme=@android:style/
Theme.NoTitleBar
 intent-filter
 action
android:name=android.intent.action.MAIN /
 category
android:name=android.intent.category.LAUNCHER /
 /intent-filter
/activity
 /application
uses-permission
android:name=android.permission.WRITE_EXTERNAL_STORAGE/
uses-permission
android:name=android.permission.READ_EXTERNAL_STORAGE/
/manifest

The GalleryView.java:

package com.mobilevideoeditor.moved;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class GalleryView extends TabActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);

 Resources res = getResources(); // Resource object to get
Drawables
 TabHost tabHost = getTabHost();  // The activity TabHost
 TabHost.TabSpec spec;  // Reusable TabSpec for each tab
 Intent intent;  // Reusable Intent for each tab

 // Create an Intent to launch an EditGallery for the tab (to be
reused)
 intent = new Intent().setClass(this, EditGalleryView.class);

 // Initialize a TabSpec for each tab and add it to the TabHost
 spec = tabHost.newTabSpec(edit).setIndicator(Edit,
   res.getDrawable(R.layout.ic_tab_edit))
   .setContent(intent);
 tabHost.addTab(spec);

 intent = new Intent().setClass(this, ShareGalleryView.class);
 spec = tabHost.newTabSpec(share).setIndicator(Share,
   res.getDrawable(R.layout.ic_tab_share))
   .setContent(intent);
tabHost.addTab(spec);

 tabHost.setCurrentTab(0);
}
}

The EditGalleryView.java (which seems to cause my problem):

package com.mobilevideoeditor.moved;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.VideoView;




public class EditGalleryView extends Activity {
 Uri[] vidUris;
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 

Re: [android-beginners] The Force Close Error is suddenly back...

2010-07-16 Thread Kostya Vasilyev
So far so good, you've successfully hit a breakpoint. Now you need to
inspect variables (Google for Eclipse debugging basics).

Also set a breakpoint whee data is handed over to the adapter, and see which
one gets hit first.

BTW, I think adding if (vidUris != null) inside getCount() will fix the
crash for now, but still - learning how to debug and understand what the
code actually does during execution is instrumental to any further
development work you plan on doing.
--
Kostya Vasilyev -- http://kmansoft.wordpress.com

17.07.2010 2:15 пользователь Victoria Busse victoriasarabu...@gmail.com
написал:

Okay, I set the breakpoint for getCount(); and this is what I got...

terminatedMoved [Android Application]
disconnectedDalvikVM[localhost:8615]
Moved [Android Application]
DalvikVM[localhost:8615]
 Thread [3 main] (Suspended (entry into method getCount in
EditGalleryView$VideoAdapter))
 EditGalleryView$VideoAdapter.getCount() line: 74
GridView.setAdapter(ListAdapter) line: 128
 EditGalleryView.onCreate(Bundle) line: 28
Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047
 ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent)
line: 2459
 ActivityThread.startActivityNow(Activity, String, Intent, ActivityInfo,
IBinder, Bundle, Object) line: 2335
 LocalActivityManager.moveToState(LocalActivityManager$LocalActivityRecord,
int) line: 127
 LocalActivityManager.startActivity(String, Intent) line: 339
TabHost$IntentContentStrategy.getContentView() line: 648
 TabHost.setCurrentTab(int) line: 320
TabHost.addTab(TabHost$TabSpec) line: 213
 GalleryView.onCreate(Bundle) line: 28
Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047
 ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent)
line: 2459
 ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent)
line: 2512
 ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord,
Intent) line: 119
 ActivityThread$H.handleMessage(Message) line: 1863
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
 Looper.loop() line: 123
ActivityThread.main(String[]) line: 4363
 Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean)
line: not available [native method]
 Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 860
 ZygoteInit.main(String[]) line: 618
NativeStart.main(String[]) line: not available [native method]
 Thread [13 Binder Thread #2] (Running)
Thread [11 Binder Thread #1] (Running)

As I am really new to all this, I don't really have clue what it means...
:p



On Fri, Jul 16, 2010 at 10:54 PM, Victoria Busse 
victoriasarabu...@gmail.com wrote:

 Thanks :...

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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Database handling - when do you open and close

2010-07-15 Thread Kostya Vasilyev
onResume / onPause are called when another activity pops in front, but 
your activity stays on the screen. So this is probably a bit much.


You could try onStart / onStop, and move the code that populates views 
with database data from onCreate to onStart.


-- Kostya

15.07.2010 18:49, Bender пишет:

Thanks for your reply. I tried to open the db only in onResume() but
that doesn't work since there are db accesses in the onCreate() method
which is called before onResume() as far as I know. I think opening
and closing the db after every access would slow the app down a lot
because i'm using the db in almost every method. I hope there is
another solution for it..

On 15 Jul., 16:07, YuviDroidyuvidr...@gmail.com  wrote:
   

Probably by opening the db both in onCreate() and onResume() in some
circustances (e.g. first execution of your app) the db will be opened twice,
which for sure is not good.
If you open the db only in onResume() it should be fine (although I didn't
try it by myself). Usually, when I need data from the db, I call db.open(),
fetch my data, and db.close(). In this way I'm pretty sure there won't be
any such leak. Still I don't know if that's the best way to do it.

YuviDroid



On Thu, Jul 15, 2010 at 3:51 PM, Benderabende...@googlemail.com  wrote:
 

Hi,
   
 

I'm writing an app which has 2 activities and gets his data from a
database. Unfortunately I'm not sure when I have to open and close the
database properly. In both activities I'm opening the database so the
activities can access its data. When I do the following:
   
 

  * Start the app
  * Open activity 1
  * Open activity 2 (via button in activity 1)
  * Hit the back button (back to activity 1)
  * Again back button (back to home screen)
  * Start the app
   
 

I'm receiving such an leak error:
   
 

07-15 14:34:19.504: ERROR/Database(234): Leak found
07-15 14:34:19.504: ERROR/Database(234):
java.lang.IllegalStateException: mPrograms size 1
07-15 14:34:19.504: ERROR/Database(234): at
android.database.sqlite.SQLiteDatabase.finalize(SQLiteDatabase.java:
1669)
07-15 14:34:19.504: ERROR/Database(234): at
dalvik.system.NativeStart.run(Native Method)
07-15 14:34:19.504: ERROR/Database(234): Caused by:
java.lang.IllegalStateException: /data/data/de.anote/databases/
anote.db SQLiteDatabase created and never closed
   
 

 more stuff .
   
 

I guess it is because I'm not closing the database so implemented the
following:
   
 

  * db.open() in both onCreate() and both onResume() methods by the 2
activities
  * db.close() in both onPause() methods.
   
 

But now I'm receiving another error:
   
 

07-15 15:27:18.472: ERROR/AndroidRuntime(266): Uncaught handler:
thread main exiting due to uncaught exception
07-15 15:27:18.508: ERROR/AndroidRuntime(266):
java.lang.RuntimeException: Unable to resume activity {de.anote/
de.anote.gui.CategoryView}: java.lang.IllegalStateException: mQuery
SELECT _id, note_name, value, date, category, priority, reminderbool,
reminder, todo FROM t_note WHERE category=? ORDER BY date 1
07-15 15:27:18.508: ERROR/AndroidRuntime(266): at
android.app.ActivityThread.performResumeActivity(ActivityThread.java:
2950)
07-15 15:27:18.508: ERROR/AndroidRuntime(266): at
android.app.ActivityThread.handleResumeActivity(ActivityThread.java:
2965)
07-15 15:27:18.508: ERROR/AndroidRuntime(266): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1889)
07-15 15:27:18.508: ERROR/AndroidRuntime(266): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-15 15:27:18.508: ERROR/AndroidRuntime(266): at
android.os.Looper.loop(Looper.java:123)
07-15 15:27:18.508: ERROR/AndroidRuntime(266): at
android.app.ActivityThread.main(ActivityThread.java:4363)
07-15 15:27:18.508: ERROR/AndroidRuntime(266): at
java.lang.reflect.Method.invokeNative(Native Method)
07-15 15:27:18.508: ERROR/AndroidRuntime(266): at
java.lang.reflect.Method.invoke(Method.java:521)
07-15 15:27:18.508: ERROR/AndroidRuntime(266): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-15 15:27:18.508: ERROR/AndroidRuntime(266): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-15 15:27:18.508: ERROR/AndroidRuntime(266): at
dalvik.system.NativeStart.main(Native Method)
07-15 15:27:18.508: ERROR/AndroidRuntime(266): Caused by:
java.lang.IllegalStateException: mQuery SELECT _id, note_name, value,
date, category, priority, reminderbool, reminder, todo FROM t_note
WHERE category=? ORDER BY date 1
07-15 15:27:18.508: ERROR/AndroidRuntime(266): at
android.database.sqlite.SQLiteQuery.requery(SQLiteQuery.java:162)
07-15 15:27:18.508: ERROR/AndroidRuntime(266): at
android.database.sqlite.SQLiteCursor.requery(SQLiteCursor.java:536)
07-15 15:27:18.508: ERROR/AndroidRuntime(266): at
android.app.Activity.performRestart(Activity.java:3736)
07-15 15:27:18.508: 

Re: [android-beginners] Canceling an Alarm in an AppWidget

2010-07-15 Thread Kostya Vasilyev

Jake,

AppWidgetProviders are transient, you can't store any data in these 
objects. They are created by Android as necessary and are destroyed, 
from what I see with my widgets, quite aggressively.


Canceling an alarm doesn't require the same Java object you used to set 
an alarm.


Just create another PendingIntent with the same values, and call 
cancel() with this new object.


This will remove the need for storing data in AppWidgetProvider instance 
variables, which you can't do.


-- Kostya

15.07.2010 19:53, Jake Colman пишет:

My AppWidget's onEnabled method creates two PendingIntents.  The first
is to get location updates and the second is for an ELAPSED_REALTIME
alarm.  The two PendingIntents are declared as private class-level
variables so that I can access them later from different methods
(obviously).  I'm having trouble canceling these PendingIntents and it
looks like its because the variable has become null.  In the case of
location updates, I crash when I execute LocationManager.removeUpdates.
In the case of the alarm, I do not crash but the alarm is not canceled.
I tried putting my cancel code in onDisabled and onDeleted (not at the
same time) but it didn't work.  Any suggestions?

My code looks as follows:

public void onDeleted(Context context, int[] AppWidgetIds) {

Log.d(ZMAppWidget, onDeleted);

// cancel location updates
LocationManager lm = (LocationManager) context
.getSystemService(Context.LOCATION_SERVICE);
lm.removeUpdates(piLocation);

// cancel the alarm used to update the time
AlarmManager alarms = (AlarmManager) context
.getSystemService(Context.ALARM_SERVICE);
alarms.cancel(piAlarm);

}

Thanks.

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Canceling an Alarm in an AppWidget

2010-07-15 Thread Kostya Vasilyev

Jake,

It isn't and it doesn't.

I know it's a little counter-intuitive, but that's the case.

AppWidgetProvider is just a special BroadcastReceiver. It is 
instantiated by Android runtime / home screen in response to events 
defined in the manifest, and provides a RemoteViews object that defines 
widget state. After that it (its process) can get killed, and 
instantiated next time it is needed to handle a broadcast.


Heck, even home screen orientation changes don't cause AppWidgetProvider 
to be instantiated - Android just uses the most recent RemoteViews it 
saves somewhere.


-- Kostya

15.07.2010 20:13, Jake Colman пишет:

Kostya,

How can it be transient?  Doesn't the instance have to remain in
existence for as long as the AppWidget exists on the Home Screen?
Clearly, I can do as you suggest; I'd just like to understand why it's
necessary.

Thanks.

...Jake


   

KV == Kostya Vasilyevkmans...@gmail.com  writes:
 

KV  Jake,

KV  AppWidgetProviders are transient, you can't store any data in
KV  these objects. They are created by Android as necessary and are
KV  destroyed, from what I see with my widgets, quite aggressively.

KV  Canceling an alarm doesn't require the same Java object you used
KV  to set an alarm.

KV  Just create another PendingIntent with the same values, and call
KV  cancel() with this new object.

KV  This will remove the need for storing data in AppWidgetProvider
KV  instance variables, which you can't do.

KV  -- Kostya

KV  15.07.2010 19:53, Jake Colman пишет:

  My AppWidget's onEnabled method creates two PendingIntents.  The
  first is to get location updates and the second is for an
  ELAPSED_REALTIME alarm.  The two PendingIntents are declared as
  private class-level variables so that I can access them later from
  different methods (obviously).  I'm having trouble canceling these
  PendingIntents and it looks like its because the variable has
  become null.  In the case of location updates, I crash when I
  execute LocationManager.removeUpdates.  In the case of the alarm,
  I do not crash but the alarm is not canceled.  I tried putting my
  cancel code in onDisabled and onDeleted (not at the same time) but
  it didn't work.  Any suggestions?

  My code looks as follows:

  public void onDeleted(Context context, int[] AppWidgetIds) {

  Log.d(ZMAppWidget, onDeleted);

  // cancel location updates
  LocationManager lm = (LocationManager) context
  .getSystemService(Context.LOCATION_SERVICE);
  lm.removeUpdates(piLocation);

  // cancel the alarm used to update the time
  AlarmManager alarms = (AlarmManager) context
  .getSystemService(Context.ALARM_SERVICE);
  alarms.cancel(piAlarm);

  }

  Thanks.



KV  -- 
KV  Kostya Vasilev -- WiFi Manager + pretty widget --

KV  http://kmansoft.wordpress.com

KV  -- 
KV  You received this message because you are subscribed to the Google

KV  Groups Android Beginners group.

KV  NEW! Try asking and tagging your question on Stack Overflow at
KV  http://stackoverflow.com/questions/tagged/android

KV  To unsubscribe from this group, send email to
KV  android-beginners+unsubscr...@googlegroups.com
KV  For more options, visit this group at
KV  http://groups.google.com/group/android-beginners?hl=en

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Implementing a Service - Call down to super?

2010-07-15 Thread Kostya Vasilyev
Calling the base class is required for IntentService and its subclasses
(such as Mark Murphy's WakefulIntentService).

16.07.2010 1:09 пользователь Justin Anderson janderson@gmail.com
написал:

Jake,

You haven't given enough information to determine if it should be called
before or after your stuff.  And it also depends on what the Service
constructor does (which I don't know because I haven't looked at the source.

I guess the point I am trying to make (that it totally depends and can't be
answered as generically as you want it to be) is best illustrated with an
example:

public class Foo
{
protected int x;

public Foo()
{
x = 3;
}
}

public class Bar1 extends Foo
{
public Bar1()
{
super();
x = 5;
}
}

public class Bar2 extends Foo
{
public Bar2()
{
x = 5;
super();
}
}

In the example above, x will have the value 5 after the Bar1 constructor
finishes but Bar2 will have the value of 3 after the constructor
finishes

So, as I said before, it completely depends on what the super class does and
what the subclass is doing.  I have not looked at the source code for
Service and I don't know what your subclass does so I don't know what case
works best...

TreKing's comments are certainly valid though.  From his observations it
seems that it does not matter.  And if it did matter you could certainly
just try both and see which way works, as he also suggested.

Personally, I ALWAYS call super in my subclasses... Even if it is just a
placeholder hook.

Sorry that my answer was too generic.  I couldn't be more specific with the
generic nature of your question.

--


There are only 10 types of people in the world...

Those who know binary and those who don't.
--




On Thu, Jul 15, 2010 at 2:47 PM, TreKing treking...@gmail.com wrote:

 On Thu, Jul 15, 2010 a...

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] ContextMenu Problem - how to resolve these menu items

2010-07-15 Thread Kostya Vasilyev
Just a guess - the menu XML failed to compile because of a string id with a
space in it (Via Bluetooth).

16.07.2010 1:25 пользователь Victoria Busse victoriasarabu...@gmail.com
написал:

Hey Justin, thanks for the reply, I just solved the problem it was within
the xml.file ...instead of   android:title=@string/Facebook I now
use android:title=Facebook and it works perfectly :)



On Thu, Jul 15, 2010 at 10:16 PM, Justin Anderson janderson@gmail.com
wrote:

 I may be wr...

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: I/O

2010-07-14 Thread Kostya Vasilyev
If you are catching IOException, a NullPointerException will slip right 
through. Happens sometimes (i.e. file open returns null, and subsequent 
code tries to write to it).


Have you checked the logcat to see what goes on?

Also note, if a crash happens while debugging, you have to hit Resume 
in Eclipse's debugging presepective before you get logcat exception 
output or the Force close dialog on the device.


-- Kostya

15.07.2010 0:28, kypriakos пишет:

To clarify my last question, by stalls or quits, I mean that I am
watching
the app execute in the DDMS console, and although I am catching
exceptions
around that particular code segment, the execution stops, no exception
is thrown and
nothing occurs thereafter. I am not sure if the execution of certain
methods imported
directly from J2SE cause the VM to have issues  - I will examine it
closer and see what
the story is there.
   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Can i remove my status bar notification without opening my app?

2010-07-13 Thread Kostya Vasilyev

Nick,

A Notification's PendingIntent can be anything you want - not 
necessarily one that launches an activity.


It can be set up to trigger a BroadcastReceiver or even a Service - 
which could clear the notification without being visible to the user.


-- Kostya

13.07.2010 11:12, Nick Richardson ?:

Hi everyone,

I have (what i hope is) a simple question.  I would like to remove my 
status bar notification when a user clicks on without my app being 
brought into the foreground in the process.


I have tried creating a new class/intent that clears my notification 
then calls finish() in the onStart and onCreate methods.  It clears 
the notification, but my app is still opened as a result of the click 
on the notification.


Any help would be appreciated.

Thanks!

--
//Nick Richardson
//richardson.n...@gmail.com mailto:richardson.n...@gmail.com
--
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] is here the right place for my question ?

2010-07-07 Thread Kostya Vasilyev

Maybe you could try geo: scheme in the links:

http://developer.android.com/guide/appendix/g-app-intents.html

07.07.2010 19:08, TreKing ?:
On Sun, Jul 4, 2010 at 5:18 PM, jean francois pion 
jean.francois.p...@free.fr mailto:jean.francois.p...@free.fr wrote:


I would like to know if there is a simple syntax/tag to define
some text as an adress to trigger the use of google maps ?


AFAIK, this is automatic. The system recognizes certain strings as 
valid addresses and creates a URI that can launch the Google Maps app.


-
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking
--
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Relationship between bindService and onServiceConnected

2010-07-07 Thread Kostya Vasilyev

Bret,

Set a breakpoint in the service's onBind method, run the code, see what 
happens.


-- Kostya

07.07.2010 19:21, Bret Foreman пишет:

I don't see anything unusual in the log. I've got a few debug messages
and they are printing out fine. I've got a debug message in
onServiceConnected that is not printing. There are no error messages
to be seen. The really odd thing is that bindService is returning true
and not throwing any exceptions.

Any other ideas?

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Clicking in an AppWidget

2010-07-02 Thread Kostya Vasilyev

Jake,

You can set an on-click PendingIntent on some other View (such as a Layout).

Whether or not it's a good idea - I guess it depends on how pretty you 
can make it look :)


-- Kostya

02.07.2010 23:19, Jake Colman пишет:

Is there a way to launch an activity simply
by clicking anywhere in the appwidget?



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: closing multiple activities

2010-07-02 Thread Kostya Vasilyev

Tollas,

First of all, there is Activity.finish(), which closes the activity.

But if the way you want your app to interact with the user doesn't fit 
the way Activities are managed by Android, perhaps you can consider 
switching views inside an Activity?


You can call setContent at any time to switch the layout, and obtain any 
necessary UI objects for the new view hierarchy (such as buttons, etc) - 
the stuff you normally do in onCreate(). Another option is to use a 
ViewFlipper, this way the entire layout with all of its variations can 
be loaded at once.


Then you could handle the back key to return to previous layout or view 
(if using a ViewFlipper).


This might be easier to implement than trying to bend Activities life cycle.

-- Kostya

02.07.2010 23:19, Tollas пишет:

All activities are developed by me.
The NEW SEARCH button will be in all 3 activities.
B is launched from A. C is launched from B by the user (based on
button clicks).

On Jul 2, 2:13 pm, Justin Andersonjanderson@gmail.com  wrote:
   

Are all three activities developed by you or are B  C third-party
activities?  In which Activity should this button reside?  Are B  C
launched from A or are they launched separately on their own by the user?

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--

On Fri, Jul 2, 2010 at 1:06 PM, Tollastolla...@gmail.com  wrote:
 

I have 3 activities, activityA, activityB  activityC.
I want to add a menu button NEW SEARCH that will destroy/finish all 3
and start a new activityA.
I do not want to finish the activities as they process as I want the
user to be able to navigate between the 3 unless the NEW SEARCH menu
option is chosen.
   
 

I guess basically I want to know how to finish activityB  C from
activityA.
   
 

Thanks!
   
 

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android
   
 

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
   
   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Appwidget Getting Location Updates

2010-07-01 Thread Kostya Vasilyev


Jake,

01.07.2010 1:04, Jake Colman пишет:

Kostya,

I already start a service to do the initial update of the widget.  Do I
just start the same service again from within the appwidget's event
handler for the broadcast event?
   


If doing this will bring the widget up-to-date, then why not?

If, on the other hand, proper updates require some data, then you can 
set extras on the intent used to start the service, and get them in the 
service's onStart / onStartCommand.

As a side question, what does the service do after it is started? Does
it just hang around wasting resources?  How does the service know that
it has done its job (updated the appwidget display) and that it has no
more work to do?
   


See

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

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

-- Kostya


...Jake


   

KV == Kostya Vasilyevkmans...@gmail.com  writes:
 

KV  Jake,

KV  PendingIntents are not limited to launching activites. When a
KV  PendingIntent fires, it just fires - the results of it firing
KV  depend on how the PI was created.

KV  If it's a broadcast event, it can be handled anywhere, and
KV  depends on where / how a handler for this broadcast event is
KV  defined.

KV  The easiest thing is to add a handler for this event to your
KV  AppWidgetProvider, this can be done in the manifest (since AWP is
KV  a BroadcastListener). Then, if building an widget update is not
KV  instant, use a Service to built it.

KV  -- Kostya

KV  30.06.2010 23:41, Jake Colman пишет:
  I would like my appwidget to get updates upon a change of location but I
  have a few questions.

  1) I start a service in the appwidget's onUpdate() method.  Is it
  appropriate to have location updates processed by the same service?

  2) When using requestLocationUpdates() am I better off to use the
  Listener form of the API or the PendingIntent form of the API?  To
  use the PendingIntent, I need to have an Activity, correct?  And in
  this instance I don't, correct?  So can the Service class create and
  use a Listener?

  Thanks.



KV  -- 
KV  Kostya Vasilev -- WiFi Manager + pretty widget --

KV  http://kmansoft.wordpress.com

KV  -- 
KV  You received this message because you are subscribed to the Google

KV  Groups Android Beginners group.

KV  NEW! Try asking and tagging your question on Stack Overflow at
KV  http://stackoverflow.com/questions/tagged/android

KV  To unsubscribe from this group, send email to
KV  android-beginners+unsubscr...@googlegroups.com
KV  For more options, visit this group at
KV  http://groups.google.com/group/android-beginners?hl=en

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Appwidget Getting Location Updates

2010-06-30 Thread Kostya Vasilyev

Jake,

PendingIntents are not limited to launching activites. When a 
PendingIntent fires, it just fires - the results of it firing depend on 
how the PI was created.


If it's a broadcast event, it can be handled anywhere, and depends on 
where / how a handler for this broadcast event is defined.


The easiest thing is to add a handler for this event to your 
AppWidgetProvider, this can be done in the manifest (since AWP is a 
BroadcastListener). Then, if building an widget update is not instant, 
use a Service to built it.


-- Kostya

30.06.2010 23:41, Jake Colman пишет:

I would like my appwidget to get updates upon a change of location but I
have a few questions.

1) I start a service in the appwidget's onUpdate() method.  Is it
appropriate to have location updates processed by the same service?

2) When using requestLocationUpdates() am I better off to use the
Listener form of the API or the PendingIntent form of the API?  To
use the PendingIntent, I need to have an Activity, correct?  And in
this instance I don't, correct?  So can the Service class create and
use a Listener?

Thanks.

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: onHandleIntent(Intent) method does not get called

2010-06-24 Thread Kostya Vasilyev

24.06.2010 10:49, appsgrrl пишет:

Hi -- Okay, I got further!  Yay!  It turns out that I also had to call
super.onCreate()  to avoid the null pointer exception.
So, if I call super.onCreate() and super.onStartCommand(),  my
onHandleIntent() does get excecuted.
   


Great. Both superclass methods need to get called - onCreate() set up a 
worker thread, and onStartCommand() queues the intent to this thread, 
which ultimately calls your onHandleIntent()

Now, my new mystery is why my service gets an onDestroy() call right
after it is started.
I return START_STICKY from onStartCommand, but that does not seem to
have an effect.
I guess I need to understand the life cycle stuff a little more.
   


This is intended behaviour. The service is stopped when the last queued 
intent has been processed by your subclass's onHandleIntent().


--

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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Triggering an AppWidget Update

2010-06-24 Thread Kostya Vasilyev

Jake,

There are two scenarios involved:

1. Android calls the widget provider's onUpdate() - when the widget is 
first shown and then regularly at updatePeriodMillis intervals, if 
specified. Note that automatic updates based on updatePeriodMillis are 
limited to once every 30 minutes since Android 2.x.


2. You are free to update your widgets any time, by doing something like 
this:


ComponentName thisWidget = new ComponentName(context, 
MyWidgetProvider.class);

AppWidgetManager manager = AppWidgetManager.getInstance(context);

RemoteViews updateViews = .. specify new widget state here ..

manager.updateAppWidget(thisWidget, updateViews);

For your calendar example, obviously the second scenario has to be involved.

As for performing updates when necessary (and only then), your code 
needs to contain some logic to figure out the appropriate time for the 
next update (based on actual calendar events and how much in advance 
they are supposed to be displayed). Then set an alarm using AlarmManager 
to update the widget.


Note that AlarmManager does not have to be used in a service, although 
sample code typically does. An alarm simply fires off a PendingIntent. 
This intent can be specific to your code, triggering a widget update 
just in time to for next scheduled calendar event.


A good place to receive this special intent is in your AppWidgetProvider 
- since it's a BroadcastReceiver anyway.


Hope this helps.

-- Kostya

24.06.2010 18:31, Jake Colman пишет:

I have some questions about the correct approach for updating an
AppWidget's display.

Since this is a beginners forum, please let me state what I already do
know:

1) I can use android::updatePeriodMillis to specify the update
interval.  When this interval has elapsed the phone is woken up.
Intervals of less than one hour are not a good idea.

2) Updates can be triggered by an alarm that will not actually wake up
the phone.

What I'm confused about is how/why/when to trigger an update.

Let's say I am creating an AppWidget that will display the time of my
next appointment.  The widget needs to know the current time and the
time of my next appointment.  When the current time is after the current
appointment the widget has to display the time of the next appointment.

For this widget to work it must be regularly checking the time and the
calendar since at any minute it might be time to display the next
appointment.  Does this mean I have to update the widget's display every
minute?  Clearly not, but how else?  In actuality, I only really need to
update the display if the user is looking at the screen.  But do we only
update if the screen is active?  If so, what about if that update is a
time-consuming process?  The UI would then appear non-responsive.

So what the is correct approach for this kind of problem?

Thanks!

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Triggering an AppWidget Update

2010-06-24 Thread Kostya Vasilyev

Jake,

There are two issues here:

- Getting notifications when appointment data changes. If the 
appointment database is your own, set up an intent to be fired whenever 
there is a change. If you are using the built-in calendar, there is got 
to be a way, too - I just don't have any pointers not having used this API.


- Time until next appointment changes with real wallclock time, so it 
would have to be updated (every minute? every second?). This is a UI 
design decision - do you think your users prefer to see time til next 
appointment with 1-second accuracy, at the expense of possibly poor 
battery life, or would they be happy with 1-minute resolution, or 
perhaps just time of next appointment, updated a few times a day?


-- Kostya

24.06.2010 19:11, Jake Colman пишет:

But let's say the appwidget displays the amount of time remaining until
the next appointment.  Since that data changes all the time, how does
one structure the widget update in that instance?
   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Triggering an AppWidget Update

2010-06-24 Thread Kostya Vasilyev

Jake,

The 30 minute minimum intervals only applies to updates specified in the 
widget's XML file (updateTimeMillis).


You can have alarm-driven (or other event driven) updates as often as 
you like, so it's only a question of judgement with respect to battery life.


Android 2.x includes analog clocks that update once a minute, so it 
can't be that bad.


Avoiding updates when the screen is off is pretty easy - just use alarm 
options without the _WAKEUP (i.e. ELAPSED_REALTIME or RTC). If such 
alarm goes of while the phone is asleep, it will be delivered when the 
phone wakes up.


-- Kostya

24.06.2010 19:36, Jake Colman пишет:

But in the second example, would it be appropriate to update every
minute?  But Android 2.2 only allows an update every 30 minutes.  Do you
set an alarm to trigger even minute or would that also drain the
battery?  Do you trigger an update only when the screen is turned on?
Can that even be detected?

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Problem with AppWidget Using a Service

2010-06-23 Thread Kostya Vasilyev

Jake,

The error is in the way your code instantiates ComponentName.

Instead of:

ComponentName thisWidget = new ComponentName(this, ZMUpdateService.class);


Do this:

ComponentName thisWidget = new ComponentName(this,*ZmanMinderAppWidget*.class);


The error message was trying to convey same thing...

-- Kostya

23.06.2010 17:39, Jake Colman ?:

I am trying to create a simple AppWidget using a service to initialize
the content in the onUpdate() method.  The data is not being refreshed
and logcat shows me the following warning:

AppWidgetService  W  updateAppWidgetProvider: provider doesn't exist:
ComponentInfo{com.jnc.zmanminder/com.jnc.zmanminder.ZMUpdateService}

I must be missing something obvious but I cannot figure it out.

My AppWidget class (edited for brevity) looks as follows:

public class ZmanMinderAppWidget extends AppWidgetProvider {
   public void onUpdate(Context context,
 AppWidgetManager appWidgetManager, int[] appWidgetIds) {
 context.startService(new Intent(context, ZMUpdateService.class));
   }
}

My Service class (edited for brevity) looks as follows:

public class ZMUpdateService extends Service {
   public void onStart(Intent intent, int startId) {
 RemoteViews updateViews = buildUpdate(this);
 ComponentName thisWidget = new ComponentName(this, ZMUpdateService.class);
 AppWidgetManager manager = AppWidgetManager.getInstance(this);
 manager.updateAppWidget(thisWidget, updateViews);
   }

   public IBinder onBind(Intent arg0) {
 return null;
   }

   public RemoteViews buildUpdate(Context context) {
 Time time = new Time();
 time.setToNow();   
 RemoteViews views = new 
RemoteViews(context.getPackageName(),R.layout.widget);
 views.setTextViewText(R.id.time, time.format(%I:%M%p));
 return views;
   }
}

The ZMUpdateService service is defined in my manifest file.

Thanks for any help.

...Jake


   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: onHandleIntent(Intent) method does not get called

2010-06-23 Thread Kostya Vasilyev

Betty,

Make sure your service calls base class methods in onCreate() and 
onStart(). Intents for processing are queued to a worker thread by 
IntentService.onStart. The worker thread is set up by onCreate.


class BettysService extends IntentService {

@Override
public void onCreate() {
... logging here ...
super.onCreate();
}

@Override
public void onStart(Intent intent, int startId) {
... logging here...
super.onStart(intent, startId);
}
.
}

BTW, Android source can be found here:

http://www.netmite.com/android/mydroid/1.6/frameworks/base/core/java/android/app/

-- Kostya

23.06.2010 18:37, appsgrrl пишет:

Hi --

Thanks for replying.   I also have a logging printout in the
onStartCommand() method, and that does show as being called.
If onStartCommand() is called, doesn't that mean my startService()
from my Activity has indeed started my IntentService?

Who ultimately calls onHandleIntent()?  That's what I cannot figure
out from the docs.

Betty


On Jun 23, 4:02 am, Mark Murphymmur...@commonsware.com  wrote:
   

On Wed, Jun 23, 2010 at 1:03 AM, appsgrrlbettyoch...@gmail.com  wrote:
 

I'm tryng to get an IntentService to work, and I have extended
IntentService, and I implemented a onHandletIntent(Intent) method.  I
put some logging in there, but this method never gets called.
   
 

I must be doing something really dumb, but I don't know what it is.
   
 

Is there something else I need to implement or override, or whatever,
to make this work?
   

No, that's pretty much it. Are you sure whatever is supposed to be
calling startService() is actually calling startService()?

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

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.6 Available!
 
   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Problem with AppWidget Using a Service

2010-06-23 Thread Kostya Vasilyev

Jake,

onUpdate is passed an explicit list of just the widget ids that need to 
be updated. Supposedly, there could be widgets that belong to this 
provider but don't need updating (e.g. on a scrolled-off home screen 
portion).


Pushing a RemoveViews object to a paricular widget is done by calling:

manager.updateAppWidget(int widgetId, updateViews);


It's also possible to update all widgets that belong to a particular 
widget provider, and this is the approach service-based widgets take, 
supposedly to avoid paying service start-up costs for each widget id.


In this case, a single RemoteViews is pushed to all widgets with a 
single call to:


manager.updateAppWidget(ComponentName thisWidget, updateViews);


-- Kostya

23.06.2010 18:57, Jake Colman пишет:

Kostya,

Thanks.  That worked like a charm.

I noticed in sample AppWidget code that does not use a service, that it
iterates the appWidgetIds array so that it updates all instances of the
widget.  However, in sample code that uses a Service, that iteration is
not done.  Is that because it is not needed for some reason?  How would
one update multiple instances using a service-based solution?

Thanks.

...Jake

   

KV == Kostya Vasilyevkmans...@gmail.com  writes:
 

KV  Jake,

KV  The error is in the way your code instantiates ComponentName.

KV  Instead of:

KV  ComponentName thisWidget = new ComponentName(this, 
ZMUpdateService.class);

KV  Do this:

KV  ComponentName thisWidget = new
KV  ComponentName(this,*ZmanMinderAppWidget*.class);

KV  The error message was trying to convey same thing...

KV  -- Kostya

KV  23.06.2010 17:39, Jake Colman ?:
  I am trying to create a simple AppWidget using a service to initialize
  the content in the onUpdate() method.  The data is not being refreshed
  and logcat shows me the following warning:

  AppWidgetService  W  updateAppWidgetProvider: provider doesn't exist:
  ComponentInfo{com.jnc.zmanminder/com.jnc.zmanminder.ZMUpdateService}

  I must be missing something obvious but I cannot figure it out.

  My AppWidget class (edited for brevity) looks as follows:

  public class ZmanMinderAppWidget extends AppWidgetProvider {
  public void onUpdate(Context context,
  AppWidgetManager appWidgetManager, int[] appWidgetIds) {
  context.startService(new Intent(context, ZMUpdateService.class));
  }
  }

  My Service class (edited for brevity) looks as follows:

  public class ZMUpdateService extends Service {
  public void onStart(Intent intent, int startId) {
  RemoteViews updateViews = buildUpdate(this);
  ComponentName thisWidget = new ComponentName(this,
  ZMUpdateService.class);
  AppWidgetManager manager = AppWidgetManager.getInstance(this);
  manager.updateAppWidget(thisWidget, updateViews);
  }

  public IBinder onBind(Intent arg0) {
  return null;
  }

  public RemoteViews buildUpdate(Context context) { 
  Time time = new Time();
  time.setToNow();  
  RemoteViews views = new
  RemoteViews(context.getPackageName(),R.layout.widget);
  views.setTextViewText(R.id.time, time.format(%I:%M%p));
  return views;
  }
  }

  The ZMUpdateService service is defined in my manifest file.

  Thanks for any help.

  ...Jake




KV  -- 
KV  Kostya Vasilev -- WiFi Manager + pretty widget --

KV  http://kmansoft.wordpress.com

KV  -- 
KV  You received this message because you are subscribed to the Google

KV  Groups Android Beginners group.

KV  NEW! Try asking and tagging your question on Stack Overflow at
KV  http://stackoverflow.com/questions/tagged/android

KV  To unsubscribe from this group, send email to
KV  android-beginners+unsubscr...@googlegroups.com
KV  For more options, visit this group at
KV  http://groups.google.com/group/android-beginners?hl=en

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Problem with AppWidget Using a Service

2010-06-23 Thread Kostya Vasilyev

Jake,

Using a service for a widget that's not doing anything lengthy to 
prepare updates seems like a bit of an overkill. Certainly it works, but 
probably not necessary.


On the other hand, using a service is definitely the way to go for 
widgets that fetch data from the Internet or some other way that can 
take a long time.


Another issue is - this is all good, until someone uses a task killer, 
discovers the service, complains that the widget spanws an unnecessary 
service that uses too much memory and cpu time, kills it, and 
uninstalls. Has happened to me.


Good thing Android 2.x includes great tools to show how memory and 
battery are used.


I hope users learn to use these tools and exercise good judgement before 
killing a service just because it's there.


-- Kostya

23.06.2010 20:15, Jake Colman пишет:

Kostya,

That makes perfect sense.  It seems like a service-based update is
really the right way to go.  It avoids any potential timeout issue and
is allows updating of all widgets at once.

Thanks for your help.

...Jake


   

KV == Kostya Vasilyevkmans...@gmail.com  writes:
 

KV  Jake,

KV  onUpdate is passed an explicit list of just the widget ids that
KV  need to be updated. Supposedly, there could be widgets that
KV  belong to this provider but don't need updating (e.g. on a
KV  scrolled-off home screen portion).

KV  Pushing a RemoveViews object to a paricular widget is done by
KV  calling:

KV  manager.updateAppWidget(int widgetId, updateViews);

KV  It's also possible to update all widgets that belong to a
KV  particular widget provider, and this is the approach
KV  service-based widgets take, supposedly to avoid paying service
KV  start-up costs for each widget id.

KV  In this case, a single RemoteViews is pushed to all widgets with
KV  a single call to:

KV  manager.updateAppWidget(ComponentName thisWidget, updateViews);

KV  -- Kostya

KV  23.06.2010 18:57, Jake Colman пишет:
  Kostya,

  Thanks.  That worked like a charm.

  I noticed in sample AppWidget code that does not use a service, that it
  iterates the appWidgetIds array so that it updates all instances of the
  widget.  However, in sample code that uses a Service, that iteration is
  not done.  Is that because it is not needed for some reason?  How would
  one update multiple instances using a service-based solution?

  Thanks.

  ...Jake


  KV == Kostya Vasilyevkmans...@gmail.com   writes:

KV  Jake,

KV  The error is in the way your code instantiates ComponentName.

KV  Instead of:

KV  ComponentName thisWidget = new ComponentName(this,
KV  ZMUpdateService.class);

KV  Do this:

KV  ComponentName thisWidget = new
KV  ComponentName(this,*ZmanMinderAppWidget*.class);

KV  The error message was trying to convey same thing...

KV  -- Kostya

KV  23.06.2010 17:39, Jake Colman ?:
 I am trying to create a simple AppWidget using a service to
 initialize
 the content in the onUpdate() method.  The data is not being
 refreshed
 and logcat shows me the following warning:
  
 AppWidgetService W updateAppWidgetProvider: provider doesn't exist:
 
ComponentInfo{com.jnc.zmanminder/com.jnc.zmanminder.ZMUpdateService}
  
 I must be missing something obvious but I cannot figure it out.
  
 My AppWidget class (edited for brevity) looks as follows:
  
 public class ZmanMinderAppWidget extends AppWidgetProvider {
 public void onUpdate(Context context,
 AppWidgetManager appWidgetManager, int[] appWidgetIds) {
 context.startService(new Intent(context, ZMUpdateService.class));
 }
 }
  
 My Service class (edited for brevity) looks as follows:
  
 public class ZMUpdateService extends Service {
 public void onStart(Intent intent, int startId) {
 RemoteViews updateViews = buildUpdate(this);
 ComponentName thisWidget = new ComponentName(this,
 ZMUpdateService.class);
 AppWidgetManager manager = AppWidgetManager.getInstance(this);
 manager.updateAppWidget(thisWidget, updateViews);
 }
  
 public IBinder onBind(Intent arg0) {
 return null;
 }
  
 public RemoteViews buildUpdate(Context context) {  
 Time time = new Time();
 time.setToNow();   
 RemoteViews views = new
 RemoteViews(context.getPackageName(),R.layout.widget);
 views.setTextViewText(R.id.time, time.format(%I:%M%p));
 return views;
 }
 }
  
 The ZMUpdateService service is defined in my manifest file.
  
 Thanks for any help.
  
 ...Jake
  
  
  

KV  -- 
KV  Kostya Vasilev -- WiFi 

Re: [android-beginners] LogCat

2010-06-22 Thread Kostya Vasilyev

Don,

I can recommend running adb logcat from the OS's command line window.

This way, it's always around, you can make it as large as you want, and 
can do filtering by piping through grep or find, if necessary.


-- Kostya

22.06.2010 22:02, DonFrench пишет:

I use LogCat a lot when debugging but it is an irritation that it
frequently has to be reset to get the latest log output. I am only
aware of two ways to get the log output when this happens: 1) Go to
the DDMS perspective and then pull down the menu in the Devices view
and select reset adb, and 2) Exit Eclipse and restart it.  Some of the
time Reset adb works but often it does not and I have to exit and
restart Eclipse.  So, first, am I doing something wrong that causes
LogCat to stop functioning?  And second, is there another way to
refresh the log other than the two methods I mentioned?  And third, is
this a bug in the Android Eclipse plug-in?  If it is, why doesn't
Google fix it?

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Transition animation for dynamic (single) view.

2010-06-20 Thread Kostya Vasilyev
Since I was curious about this as well, I looked at the source you 
pointed at.


They use a ViewSwitcher with two (or actually, more, dynamically 
created) content views.


This makes sense, since ViewSwitcher animations involve two 
representations of content - old and new, hence at least two separate 
views to render them.


-- Kostya

20.06.2010 23:08, Mark Murphy пишет:

On Sun, Jun 20, 2010 at 2:48 PM, jared.thigpenjthi...@gmail.com  wrote:
   

Alll the examples I find for transition animations (push left out,
push right in, etc.) deal with moving from one view to another. What
about an application that only has one view, but dynamically changes
the data feeding that view?

The best common example of this is the base calendar app. It has
identical views, but when you swipe forward or backward the date of
the view transitions with a swipe animation.

How do I reproduce this? Surely I don't have to inflate ViewFlippers
for the same view? And if so, what is the best way to go about this?
 

Since you elected to simultaneously cross-post here and StackOverflow,
my answer is over there:

http://stackoverflow.com/questions/3080516/how-to-transition-between-data-in-a-single-dynamic-view-in-android/3080568#3080568

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Visibility

2010-06-09 Thread Kostya Vasilyev
This is controlled in the manifest file. Just remove launcher categories for
the activity.

09.06.2010 13:47 пользователь Aviral aviral...@gmail.com написал:

I noticed that we can set a view invisible by using setvisibility()
function. Is it possible to do so for drawables also?
I want to hide an application icon which I have installed. Is it
possible??

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Can a full app (not widget) be postage stamp size?

2010-06-08 Thread Kostya Vasilyev

Congratulations, James.

Note: you can merge the broadcast receiver with your AppWidgetProvider, 
same one that handles APPWIDGET_UPDATE.


-- Kostya

08.06.2010 15:18, cellurl пишет:

I got it working. I tossed my version and started with a copy of
ApiDemos, adding code below.
One interesting observation:
ApiDemos.apk actually contains three things.
Widget:
Shortcut:
App:

The shortcut and app point to different starting points ;-)
Thanks all for holding my hand.
jp


public class ExampleBroadcastReceiver extends BroadcastReceiver {
 @Override
 public void onReceive(Context context, Intent intent) {
 String action = intent.getAction();
 if (action.equals(org.jamesp.gpscruise.UpdateWidgetAction))
 ...

public class StatusBarNotifications extends Activity {
 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);

 //Uri uri = Uri.parse(55);
 //Intent intent = new
Intent(org.jamesp.gpscruise.UpdateWidgetAction, uri);
 Intent intent = new
Intent(org.jamesp.gpscruise.UpdateWidgetAction);
 sendBroadcast(intent);


receiver android:name=.appwidget.ExampleBroadcastReceiver
android:enabled=true
intent-filter
action android:name=org.jamesp.gpscruise.UpdateWidgetAction /
/intent-filter
/receiver



   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Can a full app (not widget) be postage stamp size?

2010-06-02 Thread Kostya Vasilyev

James,

The 30 minute limit only applies to automatic updates scheduled by 
using the widget .xml desciptor.


Your widget provider can update its widgets (using the usual mechanism 
of RemoteViews) any time it wants. For example, in response to some 
other broadcast. In my application, this happens when in response to 
WiFi state changes. In yours, it could be something else.


-- Kostya

01.06.2010 5:33, james pruett ?:



Are you saying widgets can update faster than 30minutes? Polling?


public int updatePeriodMillis

Since: API Level 3 
http://developer.android.com/guide/appendix/api-levels.html#level3


How often, in milliseconds, that this AppWidget wants to be updated. 
The AppWidget manager may place a limit on how often a AppWidget is 
updated.


This field corresponds to the |android:updatePeriodMillis| attribute 
in the AppWidget meta-data file.


*Note:* Updates requested with |updatePeriodMillis| will not be 
delivered more than once every 30 minutes.





On Mon, May 31, 2010 at 10:03 AM, niko20 nikolatesl...@yahoo.com 
mailto:nikolatesl...@yahoo.com wrote:


You can make it small, but I believe it will capture all focus, so
even if you see other apps you wont be able to interact with them. I'd
think a widget work work...but yes the polling would have to be rather
high, which is not good for a widget.

What you could do is tie a widget together with an app - have an app
that runs and puts a small icon in the notification bar, and if that
app is running then the widget updates more frequently. The app is
invisible except for the notification bar. When you pull down the
bar and click on the app it can open and you can then turn it off
from in the app, and then have the widget not update anymore.

-niko

On May 31, 7:39 am, TreKing treking...@gmail.com
mailto:treking...@gmail.com wrote:
 On Sun, May 30, 2010 at 3:04 PM, cellurl gpscru...@gmail.com
mailto:gpscru...@gmail.com wrote:
  Can an app not be full-screen?

 Yes - check out themes, specifically the dialog theme.

   E.g. can I make a postage size app?

 I don't know if there are limits on the size, but probably.



-
 TreKing - Chicago transit tracking app for Android-powered
deviceshttp://sites.google.com/site/rezmobileapps/treking
http://sites.google.com/site/rezmobileapps/treking

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
mailto:android-beginners%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Eclipse not recoginizing my attached Hero, Ubuntu 9.10

2010-05-31 Thread Kostya Vasilyev
I also have an HTC Hero... Although I use it under Windows, this might 
be useful.


After connecting the phone, it doesn't show up in DDMS until after I've 
selected HTC Sync from the phone's status bar. I don't actually have 
this installed under Windows, so this fails, but makes the driver see 
the phone.


-- Kostya

01.06.2010 0:48, Anthony Meadows пишет:

I had no trouble installing everything with  previous version of
ubuntu but as I am now working currently with 9.10 I am having trouble

It recognizing that something is there but gies me the serial number
as all question marks AVD name: Unknown Target Unknown.. State: ??

This is when i go to run an application and choose from my emultor and
device.

   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Different views in a widget

2010-05-19 Thread Kostya Vasilyev

19.05.2010 22:46, Justin Anderson пишет:

The class I'm using is OpenXWidget, does anyone here have experience
with OpenX or have any ideas as to why a class that extends ImageView
wouldn't work in my Widget?


It seems that OpenXWidget is well, not a widget.

It is a View subclass, and can be used in your application within a 
regular layout.


However, it's not an Android home screen widget.

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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Different views in a widget

2010-05-19 Thread Kostya Vasilyev

You could port OpenXWidget to work with home screen widgets.

Its code structure is very close to what's needed - it does its work in 
a separate thread and updates the UI as needed.


Take a look at Wiktionary sample in Android SDK. It also does an asynch 
fetch from the Web and updates the widget with the results.


-- Kostya

19.05.2010 22:58, repole пишет:

That is correct, not the best of names for something that is an
extension of ImageView rather than a widget. I knew that going in,
however I was unaware that displaying a user defined view subclass
(like OpenXWidget) in my own widget is not possible.

Unfortunately nothing is ever as easy as I'd hope, time to try and
find a work around :)

On May 19, 2:52 pm, Kostya Vasilyevkmans...@gmail.com  wrote:
   

19.05.2010 22:46, Justin Anderson пишет:

 

The class I'm using is OpenXWidget, does anyone here have experience
with OpenX or have any ideas as to why a class that extends ImageView
wouldn't work in my Widget?
   

It seems that OpenXWidget is well, not a widget.

It is a View subclass, and can be used in your application within a
regular layout.

However, it's not an Android home screen widget.

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

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

NEW! Try asking and tagging your question on Stack Overflow 
athttp://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group 
athttp://groups.google.com/group/android-beginners?hl=en
 
   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: WQVGA not respecting android:layout_height=fill_parent for layout.

2010-05-14 Thread Kostya Vasilyev
You can build against 1.6 and set min-sdk to 3, also set supports-screens
for high and low screen support.

There was a topic here recently about properly specifying drawables.

14 мая, 2010 8:47 PM пользователь Stormtap Studios 
r...@stormtapstudios.com написал:

I've found the reason this happens.  According to the documentation:

Compatibility-mode display on larger screen-sizes
If the current screen's size is larger than your application supports,
as specified in the supports-screens element, the platform displays
the application at the baseline size (normal) and density (medium).
For screens larger than baseline, the platform displays the
application in a baseline-sized portion of the overall screen, against
a black background.

This is what's happening to me.

Unfortunately my app is being built against Android 1.5 and I can't
include the supports-screens tag in the manifest to indicate that I
support the large screens which would allow it to scale properly.
Does anyone know of a way to tell the screen to stretch / fill_parent
on large screens in Android 1.5?

Thanks,

Rob

On May 13, 7:43 pm, Stormtap Studios r...@stormtapstudios.com wrote:  Hi
guys,   I have this l...
 NEW! Try asking and tagging your question on Stack Overflow athttp://
stackoverflow.com/questions/tagged/android

  To unsubscribe from this group, send email to 
android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
 For more options, visit this group athttp://
groups.google.com/group/android-beginners?hl=en

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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Maintaining the state when changing the orientation

2010-05-13 Thread Kostya Vasilyev

See here:


http://android-developers.blogspot.com/2009/02/faster-screen-orientation-change.html


13.05.2010 12:29, Alok Kulkarni пишет:

I am having an application showing ListItems and Dialog boxes in it..
I want that when i change the orientation from Portrait to landscape 
mode, i need to maintain the state of the application .. I have 
seperate XMLs for landscape and portrait mode..

What is the best way to achieve this 
Thanks ,
Alok.
--
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] The Android emulator runs too slowly.

2010-05-12 Thread Kostya Vasilyev

You don't need to recover from a crash in any way.

When the app crashes, press Android's force close button, the same 
you'd do on a real phone.


Then start debugging again (with or without changing the code and 
redeploying).


-- Kostya

12.05.2010 19:44, T1000 пишет:
I understand that if I could write an app that didn't crash every 
time, I could just quit the app and re run it (hypothetically). 
However, that is not the case. How do I recover from a crash in the 
emulator without closing the emulator and rerunning my app in Eclipse?


At 06:42 AM 5/12/2010, you wrote:
On Wed, May 12, 2010 at 2:42 AM, T1000 
mailto:t1...@zando.dyndns.orgt1...@zando.dyndns.org wrote:

It takes me five minutes to load and run Hello Android!


Just to be clear - you don't have to load up the emulator each time 
you run your app. You should load it once (which is known to take 
quite some time) and then leave it up as long as you're working on 
your project (or something goes wrong with Eclipse / adb / DDMS , 
etc, forcing you to restart).


- 


TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/trekinghttp://sites.google.com/site/rezmobileapps/treking 



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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/androidhttp://stackoverflow.com/questions/tagged/android 



To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=enhttp://groups.google.com/group/android-beginners?hl=en 








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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Communicating between multiple Apps/Widgets?

2010-05-12 Thread Kostya Vasilyev

That wouldn't work.

App widgets are stateless by design.

The way to implement what you want (from what I can tell) is to 
broadcast an intent when the user clicks on the widget and handle it in 
the AppWidgetProvider.


To make the widget broadcast an intent when clicked, use PendingIntent 
with a custom (defined within your app) action string, and attach it to 
the view with RemoteViews.setOnClickPendingIntent.


I have a post about this here:

http://kmansoft.wordpress.com/2010/04/10/processing-widget-events-with-pendingintents/

-- Kostya

12.05.2010 20:19, repole пишет:

Thanks for the quick response

I figured the widget could store a variable that's altered on
OnEnabled(), OnDisabled(), etc, and then the app could retrieve that
variable from the widget...or would that note work?

On May 12, 12:15 pm, Justin Andersonjanderson@gmail.com  wrote:
   

I do not believe it is possible to determine if a widget is visible, or even
if it is used...

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--



On Wed, May 12, 2010 at 10:11 AM, repolen.rep...@gmail.com  wrote:
 

Hey all,
   
 

Very new to Android development and trying to get started on a
project. I am curious if it is possible for a separate application to
directly check to see if another widget is open/visible etc., and for
that separate application to send information to the widget? Apologies
is this should be obvious, I've tried searching for examples and not
really come up with anything definitive.
   
 

Thanks,
Repole
   
 

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android
   
 

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
   

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

NEW! Try asking and tagging your question on Stack Overflow 
athttp://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group 
athttp://groups.google.com/group/android-beginners?hl=en
 
   



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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Communicating between multiple Apps/Widgets?

2010-05-12 Thread Kostya Vasilyev

12.05.2010 21:02, Justin Anderson ?:

/// App widgets are stateless by design./
True, but depending on what you are wanting to do, you can store state 
using SharedPreferences...


Correct.

It's also possible to store state in SharedPreferences, or SQLLite, or 
via a web service - but any of those is a mechanism external to 
AppWidgetProvider itself.


The Java object declared in the manifest (AppWidgetProvider subclass) is 
stateless, and can (and will be) recreated and disposed of by Android. 
There are no guarantees about its lifetime - only that appropriate 
methods will be called upon relevant events.


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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Human interface guidelines. Equivalent to iPhone sectioned table

2010-05-05 Thread Kostya Vasilyev

The Android Dev Guide does exist:

http://developer.android.com/guide/practices/ui_guidelines/index.html

It covers in detail how application is supposed to guide the user from one  
activity to another.


However, it does not specifically cover your question.

Perhaps you could use a list view, make it look like Android's built-in  
preference screens, with two-line items, each containing the name of  
action to be taken and its description in smaller text below.


By adding nice graphics in the top portion of the view, and using a theme  
to set colors to something nice (other than the default white-on-black), I  
think can be made look quite good.


-- Kostya

Danny Pimienta danny...@gmail.com писал(а) в своём письме Wed, 05 May  
2010 21:54:40 +0400:



I would be interested in a answer to this as well.

On May 5, 2010 12:20 PM, david2 enki1...@gmail.com wrote:

Hello,
Does Google or anyone publish UI guidelines for Android?

In particular, when moving an app from the iPhone to Android, are
there any conventions for equivalent UI controls or suggested UI
design?

On the iPhone, the sectioned table view is used to provide multiple
choices for paths to follow through an application.

What is the suggested equivalent on Android? Do any UI guidelines
exist? I'm trying to come up with something that looks nice. The
iPhone version has an image background surrounding the table.

Some options I can think of include:
- A series of buttons: Not sure if this will look cheesy.
- A list view: Typically consumes the whole window. Doesn't look as
nice as the iPhone version.
- A list view inset in a window: I've done this before. Looks ok.
Corners are not rounded like they are on the iPhone. Can do a
background.

Any suggestions?

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en




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


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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Smarter widget updates

2010-04-30 Thread Kostya Vasilyev
Hi,

I have a widget that displays detailed WiFi state (SSID, signal, etc).

It registers in the manifest to receive various android.net.wifi.*
notifications. So far so good.

However, these notifications are not sent if the home screen is side-
scrolled, or phone is screen-locked. This is good - improves battery
time and performance.

The bad side of this, though, is that since WiFi state can change
while
the widget is not visible, I have to request frequent scheduled
updates in my appwidget-provider xml descriptor to bring the widget
completely up to date when it's scrolled into view or phone screen is
unlocked.

After the widget comes into view and is updated, further updates could
be driven again by android.net.wifi.* notifications, but scheduled
onUpdate()'s continue to run, which is a waste.

Is there a way to register my AppWidgetProvider for a smart one-tme
update when it's becomes visible, either after side-scrolling, or
after the screen is unlocked?

-- Kostya Vasilyev
-- http://kmansoft.wordpress.com/sw/

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en