Re: [android-developers] Add Admob in PreferenceScreen at LiveWallpaper setting screen

2011-10-16 Thread TreKing
On Sat, Oct 15, 2011 at 9:35 PM, Perry168 perry...@gmail.com wrote:

 From the web, I found some solution. Unluckly, I don't know why the AD
 haven't show on the screen.


If you don't even explain what solution you tried and what's not working,
you're not really going to get much help.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

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

[android-developers] Re: Button Animation

2011-10-16 Thread F4L|{0
thanks for answer
Yes I used android:fillAfter but this is used to fix the animation.

can somebody help me?

On 14 Ott, 17:14, Justin Anderson magouyaw...@gmail.com wrote:
 Perhaps this is what you are looking for?  Never used it so I'm not sure,
 but look at this animation property:

 http://developer.android.com/reference/android/view/animation/Animati...

 Thanks,
 Justin Anderson
 MagouyaWare Developerhttp://sites.google.com/site/magouyaware







 On Fri, Oct 14, 2011 at 8:28 AM, TreKing treking...@gmail.com wrote:
  On Fri, Oct 14, 2011 at 8:54 AM, F4L|{0 simone.dolcio...@gmail.comwrote:

  because i don't know how do it. :)

  What did you try? There are numerous functions on View that would appear to
  allow you to manipulate its layout properties.

  --- 
  --
  TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
  transit tracking app for Android-powered devices

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

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


[android-developers] Re: Button Animation

2011-10-16 Thread F4L|{0
thanks for answer
Yes I used android:fillAfter but this is used to fix the animation.

can somebody help me?

On 14 Ott, 17:14, Justin Anderson magouyaw...@gmail.com wrote:
 Perhaps this is what you are looking for?  Never used it so I'm not sure,
 but look at this animation property:

 http://developer.android.com/reference/android/view/animation/Animati...

 Thanks,
 Justin Anderson
 MagouyaWare Developerhttp://sites.google.com/site/magouyaware







 On Fri, Oct 14, 2011 at 8:28 AM, TreKing treking...@gmail.com wrote:
  On Fri, Oct 14, 2011 at 8:54 AM, F4L|{0 simone.dolcio...@gmail.comwrote:

  because i don't know how do it. :)

  What did you try? There are numerous functions on View that would appear to
  allow you to manipulate its layout properties.

  --- 
  --
  TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
  transit tracking app for Android-powered devices

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

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


[android-developers] Re: ListView disappears after return from activity

2011-10-16 Thread Ali Chousein
My first wild guess is that you might a problem in your onStart or
onResume of the activity which hosts your ListView.

-
Ali Chousein
Weather-Buddy
http://weatherbuddy.blogspot.com/
Geo-Filtered Assistant
http://geo-filtered-assistant.blogspot.com/

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


[android-developers] listview adapter. Recycle bitmap

2011-10-16 Thread emanuele
Hello guys.. that s my baseAdapter getview implmentation:

@Override
public View getView(int position, View convertView, ViewGroup parent)
{

int type = getItemViewType(position);
if (convertView == null) {
switch (type) {
case TYPE_BIG_NEWS:
convertView = 
mInflater.inflate(R.layout.big_news, null);
break;
case TYPE_NORMAL_NEWS:
convertView = 
mInflater.inflate(R.layout.normal_news, null);
break;
default:
break;
}
}

ImageView thumb = (ImageView)
convertView.findViewById(R.id.thumbId);




File f = null;
if (filename != null)
f = mFileCache.getFile(i.newsKey, filename);
if (f == null) {
if (mGetThumbsThread != null  filename != 
null) {
Log.i(TAG, cache miss);
thumbLinks.offer(new 
ThumbRequest(i.newsKey, i.thumbLink,
i.thumbName));
mGetThumbsThread.signal();
}
thumb.setImageResource(placeHolder);
} else {
Log.i(TAG,
file bitmap cached:  + 
f.getName() +  size:  + f.length() /
1024);
bitmap = 
BitmapFactory.decodeFile(f.getAbsolutePath());
thumb.setImageBitmap(bitmap);
}

return convertView;
}


Every row is compound of text and an ImageView. Is there any chance to
recycle the bitmap I use in the getView?

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


[android-developers] Re: send SMS from adb without using mobilenetwork

2011-10-16 Thread Ali Chousein
Check the information at 
http://developer.android.com/guide/developing/devices/emulator.html#sms
You can sent SMS messages to an emulator at least. I have never tried
it, but maybe you can also send SMS messages to a phone by specifying
the device ID. But as I said, I'm not sure if you can send it to a
phone.

-
Ali Chousein
Weather-Buddy
http://weatherbuddy.blogspot.com/
Geo-Filtered Assistant
http://geo-filtered-assistant.blogspot.com/

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


[android-developers] Re: Can't respond to user comments

2011-10-16 Thread Anil Jagtap
There are always some perverts writing irresponsible comments.
As Kostya Vasilyev  said, write to Google about it.


On Oct 15, 8:50 pm, rastyrori rastyr...@gmail.com wrote:
 Today a user posted a comment about my app claiming that it accesses
 the user's phone numbers and calling history, which is completely
 untrue! Unfortunately, from the posted name, I cannot figure out who
 this person is to clear this up. This will possible hurt my sales and
 I have no way to respond!

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


[android-developers] Re: Add Admob in PreferenceScreen at LiveWallpaper setting screen

2011-10-16 Thread Perry168
Because I tried too much solution within 2 days, following is a one of
the solution.

layout/ad_layout.xml

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




AdPreference.java

public class AdPreference extends Preference {

public AdPreference(Context context, AttributeSet attrs, int
defStyle) {super(context, attrs, defStyle);}
public AdPreference(Context context, AttributeSet attrs)
{super(context, attrs);}
public AdPreference(Context context) {super(context);}

@Override
protected View onCreateView(ViewGroup parent) {
// this will create the linear layout defined in
ads_layout.xml
View view = super.onCreateView(parent);

// the context is a PreferenceActivity
Activity activity = (Activity)getContext();

// Create the adView
AdView adView = new AdView(activity, AdSize.BANNER, your add
id);

((LinearLayout)view).addView(adView);

// Initiate a generic request to load it with an ad
AdRequest request = new AdRequest();
adView.loadAd(request);

return view;
}
}



add to current setting.xml

?xml version=1.0 encoding=utf-8?
PreferenceScreen xmlns:android=http://schemas.android.com/apk/res/
android

...

com...AdPreference android:layout=@layout/ad_layout/

...
/PreferenceScreen




On 10月16日, 下午2時43分, TreKing treking...@gmail.com wrote:
 On Sat, Oct 15, 2011 at 9:35 PM, Perry168 perry...@gmail.com wrote:
  From the web, I found some solution. Unluckly, I don't know why the AD
  haven't show on the screen.

 If you don't even explain what solution you tried and what's not working,
 you're not really going to get much help.

 ---­--
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

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


[android-developers] setText for a TextView sometimes produces FC

2011-10-16 Thread Ben Lee
Hi,
Very rarely, my app crashes in setText.
Here is the detail:

java.lang.ArrayIndexOutOfBoundsException: index=4 length=4
 at android.text.AndroidBidi.directions(AndroidBidi.java:65)
 at android.text.StaticLayout.out(StaticLayout.java:680)
 at android.text.StaticLayout.generate(StaticLayout.java:380)
 at android.text.DynamicLayout.reflow(DynamicLayout.java:261)
 at android.text.DynamicLayout.init(DynamicLayout.java:150)
 at android.widget.TextView.makeNewLayout(TextView.java:5523)
 at android.widget.TextView.checkForRelayout(TextView.java:6022)
 at android.widget.TextView.setText(TextView.java:2826)
 at android.widget.TextView.setText(TextView.java:2691)
 at android.widget.TextView.setText(TextView.java:2666)
 at my.handrite.widget.NoteIndexItemView.setNote(NoteIndexItemView.java:100)

In my code, it looks like this:
99SpannableStringBuilder spannable_string = note.getSpannableString();
100   mTextView.setText(spannable_string);
This happens very rarely, I only get this issue from android market's issue
report, never happens when I debug.

I want to read the source code of android, but unfortunately,
AndroidBidi.java(in android 2.2, android 2.3) don't have row 65(as in the
issue report)--it don't have that much rows.
So I guess this may happened in Android 3.0+, which we don't have access to
the source code yet.

Is it possible to find the bug?
Thank you!

-- 
Best Regards,
Ben Lee

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

Re: [android-developers] Re: Can't respond to user comments

2011-10-16 Thread Nikolay Elenkov
On Sun, Oct 16, 2011 at 7:16 PM, Anil Jagtap anil.so...@gmail.com wrote:
 There are always some perverts writing irresponsible comments.
 As Kostya Vasilyev  said, write to Google about it.

Unfortunately, there are some 'security' apps that warn people about
possibly dangerous apps, and some blow app permissions
out of proportion. I've had users 1-star my app because Lookout, etc.
scared them pretty badly. You can try writing Google, but the best
thing is probably to get used to it :) You can also post a comment
explaining that what @user said is not true, and if comments
are sorted by time, it will show up on top.

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


Re: [android-developers] Phone's camera facing given gps coordinates

2011-10-16 Thread lbendlin
or you let the Google Location API do the work for you.  
myLocation.bearingTo(theOtherLocation)

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

[android-developers] Re: Add Admob in PreferenceScreen at LiveWallpaper setting screen

2011-10-16 Thread Perry168
Because I tried too much solution within 2 days, following is a one
of
the solution.

layout/ad_layout.xml


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


AdPreference.java


public class AdPreference extends Preference {


public AdPreference(Context context, AttributeSet attrs, int
defStyle)  {super(context, attrs, defStyle);}
public AdPreference(Context context, AttributeSet attrs)
{super(context, attrs);}
public AdPreference(Context context) {super(context);}


@Override
protected View onCreateView(ViewGroup parent) {
// this will create the linear layout defined in
ads_layout.xml
View view = super.onCreateView(parent);


// the context is a PreferenceActivity
Activity activity = (Activity)getContext();


// Create the adView
AdView adView = new AdView(activity, AdSize.BANNER,  ad id
);


((LinearLayout)view).addView(adView);


// Initiate a generic request to load it with an ad
AdRequest request = new AdRequest();
adView.loadAd(request);


return view;
}



}


add to current setting.xml

?xml version=1.0 encoding=utf-8?
PreferenceScreen xmlns:android=http://schemas.android.com/apk/res/
android


...


com...AdPreference android:layout=@layout/ad_layout/


...
/PreferenceScreen

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


[android-developers] Re: Undefined Reference - ffmpeg on android ndk

2011-10-16 Thread Gabriel Simões
I forgot to add my build script:

NDK=/cygdrive/c/Gabriel/Desenvolvimento/SDKs/Android/android-ndk-r4-
crystax
PLATFORM=$NDK/build/platforms/android-8/arch-arm/
PREBUILT=$NDK/build/prebuilt/windows/arm-eabi-4.4.0


function build_one
{

./configure --target-os=linux \
--prefix=$PREFIX \
--enable-cross-compile \
--extra-libs=-lgcc \
--arch=arm \
--cc=$PREBUILT/bin/arm-eabi-gcc \
--cross-prefix=$PREBUILT/bin/arm-eabi- \
--nm=$PREBUILT/bin/arm-eabi-nm \
--sysroot=$PLATFORM \
--extra-cflags= -O2 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -
Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums  -
fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS  \
--disable-shared \
--enable-static \
--extra-ldflags=-Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/
lib  -nostdlib -lc -lm -ldl -llog \
--disable-stripping \
--disable-debug \
--disable-symver \
--disable-ffprobe \
--disable-devices \
--disable-avfilter \
--disable-swscale \
--disable-ffplay \
--disable-ffserver \
--disable-network \
(many more ...)
--enable-asm \
$ADDITIONAL_CONFIGURE_FLAG

#make clean
make  -j4 install

$PREBUILT/bin/arm-eabi-ar d libavcodec/libavcodec.a inverse.o

$PREBUILT/bin/arm-eabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/
usr/lib  -soname libffmpeg.so -shared -nostdlib  -z,noexecstack -
Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so
libavcodec/libavcodec.a libavformat/libavformat.a libavutil/
libavutil.a  -lc -lm -lz -ldl -llog  --warn-once  --dynamic-linker=/
system/bin/linker $PREBUILT/lib/gcc/arm-eabi/4.4.0/libgcc.a

}

#arm v5
CPU=armv5te
OPTIMIZE_CFLAGS=-marm -march=$CPU
PREFIX=./android/$CPU
ADDITIONAL_CONFIGURE_FLAG=
build_one

On Oct 16, 2:48 am, Gabriel Simões gsim...@gmail.com wrote:
 I´ve spent many hours trying to figure out why I still get undefined
 reference when trying to link to ffmpeg. I´ve already read most of
 not all posts and sites about the subject, so I think I´m missing
 something little here and I hope you can help me.

 What I have:

 I´m using windows 7 + cygwin + crystax r4. I´ve compiled FFMPEG using
 RockPlayer's ffmpeg source plus some modifications I did (only to
 include / exclude demuxes, decoders, encoders, ...) After compiling, I
 get:

 a new folder named armv5te, which includes:
 a folder named include with all folders for each libs' .h
 a folder named lib which includes all libs' .a
 a shared library named libffmpeg.so (checked soname and it is
 libffmpeg)
 The shared library isn´t also placed on project/lib/armeabi/
 libffmpeg.so

 After compiling I tried to compile my project and link it. While
 my .cpp compiles ok, I get many undefined references.

 Here is my android.mk:
 --
 LOCAL_PATH := $(call my-dir)
 #declare the prebuilt library
 include $(CLEAR_VARS)
 LOCAL_MODULE := ffmpeg-prebuilt
 LOCAL_SRC_FILES := $(LOCAL_PATH)/ffmpeg/android/armv5te/libffmpeg.so
 LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ffmpeg/android/armv5te/
 include
 LOCAL_PRELINK_MODULE := true
 include $(PREBUILT_SHARED_LIBRARY)

 include $(CLEAR_VARS)
 LOCAL_MODULE    := audiocodec
 LOCAL_SRC_FILES := ffmpeg_audio.cpp
 LOCAL_SHARED_LIBRARY := libffmpeg
 LOCAL_C_INCLUDES := $(LOCAL_PATH)/ffmpeg/android/armv5te/include
 LOCAL_LDLIBS    := -llog -ljnigraphics -lz -lm $(LOCAL_PATH)/ffmpeg/
 android/armv5te/libffmpeg.so
 include $(BUILD_SHARED_LIBRARY)
 --

 The result:
 --
 Compile++ thumb: audiocodec = /cygdrive/c/Gabriel/Desenvolvimento/
 Workspace/FFM
 PEG/jni/ffmpeg_audio.cpp
 SharedLibrary  : libaudiocodec.so
 /cygdrive/c/Gabriel/Desenvolvimento/Workspace/FFMPEG/obj/local/armeabi/
 objs/audi
 ocodec/ffmpeg_audio.o: In function
 `Java_gabriel_audioslower_pro_ffmpegDecoder_r
 eadSamples':
 /cygdrive/c/Gabriel/Desenvolvimento/Workspace/FFMPEG/jni/
 ffmpeg_audio.cpp:172: u
 ndefined reference to `avcodec_decode_audio3(AVCodecContext*, short*,
 int*, AVPa
 cket*)'
 /cygdrive/c/Gabriel/Desenvolvimento/Workspace/FFMPEG/jni/
 ffmpeg_audio.cpp:178: u
 ndefined reference to `av_read_frame(AVFormatContext*, AVPacket*)'
 /cygdrive/c/Gabriel/Desenvolvimento/Workspace/FFMPEG/obj/local/armeabi/
 objs/audi
 ocodec/ffmpeg_audio.o: In function
 `Java_gabriel_audioslower_pro_ffmpegDecoder_s
 eekToPosMS':
 /cygdrive/c/Gabriel/Desenvolvimento/Workspace/FFMPEG/jni/
 ffmpeg_audio.cpp:147: u
 ndefined reference to `av_rescale_q(long long, AVRational,
 AVRational)'
 /cygdrive/c/Gabriel/Desenvolvimento/Workspace/FFMPEG/jni/
 ffmpeg_audio.cpp:150: u
 ndefined reference to `av_seek_frame(AVFormatContext*, int, long long,
 int)'
 /cygdrive/c/Gabriel/Desenvolvimento/Workspace/FFMPEG/jni/
 ffmpeg_audio.cpp:151: u
 ndefined reference to `avcodec_flush_buffers(AVCodecContext*)'
 /cygdrive/c/Gabriel/Desenvolvimento/Workspace/FFMPEG/jni/
 ffmpeg_audio.cpp:152: u
 ndefined reference 

Re: [android-developers] news app

2011-10-16 Thread Chris Stewart
What you want are two fragments, one for the article view and one for the 
article detail view.  You then would have an activity (or two) to manage them 
based on phone versus tablet.  The fragments would communicate back to the base 
activity when something happens, say a touch on the article view, and the base 
activity would react as needed based on which type of device it's on.  So if 
it's a tablet, where the base activity is managing both fragments, it would 
simply call a method on the article detail fragment.  If it was on a phone, the 
base activity would use an intent to start the second activity.  Make sense?

Chris Stewart
http://locomolabs.com



On Aug 22, 2011, at 5:30 PM, bob wrote:

 Ok, let's say you are working on a news app.
 
 So, you have a ListView with some article titles.
 
 Then, when an article is clicked you have a TextView that replaces the
 ListView.
 
 What is the best way to do this?
 
 I'm thinking of having the ListView and TextView on top of each other
 in an AbsoluteLayout and showing/hiding as needed.
 
 Or, I can create two XML files and using setContentView as needed.
 
 Any ideas?
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

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


[android-developers] Recently released: Weather-Buddy

2011-10-16 Thread Ali Chousein
An Android weather application for travelers and commuters. More
information at:

http://weatherbuddy.blogspot.com/
http://twitter.com/weather_buddy

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


[android-developers] Time/CountDownTimer: Wrong millis returned for date/time - HELP PLEASE!!

2011-10-16 Thread Larry/MavrickProductions
I am writing a program for my kids to count down to Christmas. I have
been playing with android programming for a year, read books, look
online for help, but this one is really got me stumped.

In the java, I use Time (var) .set(mm, dd, ) and long millis =
(var) .toMillis(true) to convert 12/25/2011 to milliseconds from the
epoch. According to 
http://www.esqsoft.com/javascript_examples/date-to-epoch.htm,
12/25/2011 should equal 1324789200. But when I look at the converted
result in the test window (I added code to show the long results
before the human readable) it shows 12/25/2011 as -877432832.

My code is below. I'm sure that I'm missing something simple/stupid.
Any help is greatly appreciated!!

Best, -Larry

### CODE BELOW ###


package com.mavrick.countdowntester3;

import java.util.concurrent.TimeUnit;
import android.app.Activity;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.format.Time;
import android.widget.TextView;

public class counttime extends Activity {
private TextView mTextField;
private Time TimerSet;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

final TextView mTextField = (TextView)
findViewById(R.id.textView1);

Time TimerSet = new Time();
TimerSet.set(12, 25, 2011);  // set the date to Dec 25, 2011,
12am
TimerSet.normalize(true);
long millis = TimerSet.toMillis(true);

Time TimeNow = new Time();
TimeNow.setToNow();  // set the date to Current Time
TimeNow.normalize(true);
long millis2 = TimeNow.toMillis(true);

long millisset = millis - millis2;   //subtract current from
future to set the time remaining

final int smillis = (int) (millis);  //convert long to integer to
display conversion results
final int smillis2 = (int) (millis2);

new CountDownTimer(millisset, 1000) {
 public void onTick(long millisUntilFinished) {

 // decompose difference into days, hours, minutes and
seconds parts
 int weeks   = (int) ((millisUntilFinished / 1000) /
604800);
 int days= (int) ((millisUntilFinished / 1000) / 
86400);
 int hours   = (int) (((millisUntilFinished / 1000) - 
(days
* 86400)) / 3600);
 int minutes = (int) (((millisUntilFinished / 1000) - 
((days
* 86400) + (hours * 3600))) / 60);
 int seconds = (int) ((millisUntilFinished / 1000) % 
60);
 int millicn = (int) (millisUntilFinished / 1000);

 //write the data: future time, current time, remaining
time, then human readable

 mTextField.setText(smillis +   + smillis2 + 
  +
millicn + Time remaining:  + weeks +   + days +   + hours +  
+ minutes +   + seconds);
 }

 public void onFinish() {
 mTextField.setText(done!);
 }
  }.start();
}
}

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


Re: [android-developers] Time/CountDownTimer: Wrong millis returned for date/time - HELP PLEASE!!

2011-10-16 Thread Christopher Van Kirk

Possibly a signed/unsigned problem. Try using an unsigned long.


On 10/17/2011 4:55 AM, Larry/MavrickProductions wrote:

I am writing a program for my kids to count down to Christmas. I have
been playing with android programming for a year, read books, look
online for help, but this one is really got me stumped.

In the java, I use Time (var) .set(mm, dd, ) and long millis =
(var) .toMillis(true) to convert 12/25/2011 to milliseconds from the
epoch. According to 
http://www.esqsoft.com/javascript_examples/date-to-epoch.htm,
12/25/2011 should equal 1324789200. But when I look at the converted
result in the test window (I added code to show the long results
before the human readable) it shows 12/25/2011 as -877432832.

My code is below. I'm sure that I'm missing something simple/stupid.
Any help is greatly appreciated!!

Best, -Larry

### CODE BELOW ###


package com.mavrick.countdowntester3;

import java.util.concurrent.TimeUnit;
import android.app.Activity;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.format.Time;
import android.widget.TextView;

public class counttime extends Activity {
private TextView mTextField;
private Time TimerSet;
 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);

 final TextView mTextField = (TextView)
findViewById(R.id.textView1);

 Time TimerSet = new Time();
TimerSet.set(12, 25, 2011);  // set the date to Dec 25, 2011,
12am
TimerSet.normalize(true);
long millis = TimerSet.toMillis(true);

Time TimeNow = new Time();
TimeNow.setToNow();  // set the date to Current Time
TimeNow.normalize(true);
long millis2 = TimeNow.toMillis(true);

long millisset = millis - millis2;   //subtract current from
future to set the time remaining

final int smillis = (int) (millis);  //convert long to integer to
display conversion results
final int smillis2 = (int) (millis2);

 new CountDownTimer(millisset, 1000) {
 public void onTick(long millisUntilFinished) {

 // decompose difference into days, hours, minutes and
seconds parts
 int weeks   = (int) ((millisUntilFinished / 1000) /
604800);
 int days= (int) ((millisUntilFinished / 1000) / 
86400);
 int hours   = (int) (((millisUntilFinished / 1000) - 
(days
* 86400)) / 3600);
 int minutes = (int) (((millisUntilFinished / 1000) - 
((days
* 86400) + (hours * 3600))) / 60);
 int seconds = (int) ((millisUntilFinished / 1000) % 
60);
 int millicn = (int) (millisUntilFinished / 1000);

 //write the data: future time, current time, remaining
time, then human readable

 mTextField.setText(smillis +   + smillis2 +  
 +
millicn + Time remaining:  + weeks +   + days +   + hours +  
+ minutes +   + seconds);
  }

  public void onFinish() {
  mTextField.setText(done!);
  }
   }.start();
 }
}



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


Re: [android-developers] Time/CountDownTimer: Wrong millis returned for date/time - HELP PLEASE!!

2011-10-16 Thread Kostya Vasilyev

The value from the JavaScript is in seconds.

Converted to milliseconds, it does not fit in a 4-byte integer 
(0x*134*_7396F480_), that's why normally longs (8 bytes) are used for 
time stamps.


You don't really need to convert the values to ints just for the sake of 
a number-to-string conversion.


Either declare smillis, smillis2 as longs and remove the typecast (to 
see milliseconds):


final*long*smillis = millis;
final*long*smillis2 = millis2;


or divide millis and millis2 by 1000 (to see seconds):

final int smillis = (int) (millis*  / 1000L*);
final int smillis2 = (int) (millis2*  / 1000L*);

-- Kostya

17.10.2011 0:55, Larry/MavrickProductions ?:

I am writing a program for my kids to count down to Christmas. I have
been playing with android programming for a year, read books, look
online for help, but this one is really got me stumped.

In the java, I use Time (var) .set(mm, dd, ) and long millis =
(var) .toMillis(true) to convert 12/25/2011 to milliseconds from the
epoch. According to 
http://www.esqsoft.com/javascript_examples/date-to-epoch.htm,
12/25/2011 should equal 1324789200. But when I look at the converted
result in the test window (I added code to show the long results
before the human readable) it shows 12/25/2011 as -877432832.

My code is below. I'm sure that I'm missing something simple/stupid.
Any help is greatly appreciated!!

Best, -Larry

### CODE BELOW ###


package com.mavrick.countdowntester3;

import java.util.concurrent.TimeUnit;
import android.app.Activity;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.format.Time;
import android.widget.TextView;

public class counttime extends Activity {
private TextView mTextField;
private Time TimerSet;
 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);

 final TextView mTextField = (TextView)
findViewById(R.id.textView1);

 Time TimerSet = new Time();
TimerSet.set(12, 25, 2011);  // set the date to Dec 25, 2011,
12am
TimerSet.normalize(true);
long millis = TimerSet.toMillis(true);

Time TimeNow = new Time();
TimeNow.setToNow();  // set the date to Current Time
TimeNow.normalize(true);
long millis2 = TimeNow.toMillis(true);

long millisset = millis - millis2;   //subtract current from
future to set the time remaining

final int smillis = (int) (millis);  //convert long to integer to
display conversion results
final int smillis2 = (int) (millis2);

 new CountDownTimer(millisset, 1000) {
 public void onTick(long millisUntilFinished) {

 // decompose difference into days, hours, minutes and
seconds parts
 int weeks   = (int) ((millisUntilFinished / 1000) /
604800);
 int days= (int) ((millisUntilFinished / 1000) / 
86400);
 int hours   = (int) (((millisUntilFinished / 1000) - 
(days
* 86400)) / 3600);
 int minutes = (int) (((millisUntilFinished / 1000) - 
((days
* 86400) + (hours * 3600))) / 60);
 int seconds = (int) ((millisUntilFinished / 1000) % 
60);
 int millicn = (int) (millisUntilFinished / 1000);

 //write the data: future time, current time, remaining
time, then human readable

 mTextField.setText(smillis +   + smillis2 +  
 +
millicn + Time remaining:  + weeks +   + days +   + hours +  
+ minutes +   + seconds);
  }

  public void onFinish() {
  mTextField.setText(done!);
  }
   }.start();
 }
}



--
Kostya Vasilyev

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

[android-developers] Re: Custom compass image bounds in subclassed MyLocationOverlay

2011-10-16 Thread stephen
OK - so the answer isn't canvas.scale (that scales up the bitmaps).
How can the canvas be manipulated to increase its size (i.e. provide
more room to draw my images)?

Thanks,

Stephen

On Oct 11, 9:23 am, stephen stephen.trai...@gmail.com wrote:
 Makes sense. So something like:

 canvas.save
 canvas.scale
 // do drawing...
 canvas.restore

 ?

 Or is there some other way to increase the canvas bounds that I should
 be using?

 Thanks,

 Stephen

 On Oct 11, 6:15 am, TreKing treking...@gmail.com wrote:







  On Mon, Oct 10, 2011 at 11:13 PM, stephen stephen.trai...@gmail.com wrote:
   How do you set the bounds of the custom imagery so that calls
   to drawCompass set the required bounds on the canvas object?

  You could try saving the current state of the Canvas, doing your drawing,
  then restoring it.

  --- 
  --
  TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
  transit tracking app for Android-powered devices

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


[android-developers] Re: Time/CountDownTimer: Wrong millis returned for date/time - HELP PLEASE!!

2011-10-16 Thread Larry/MavrickProductions
Thank you both for the replies!

Actually, the strings are not the problem. The human date/time to
millisecond conversions are wrong.

12/25/2011 should equal 1324789200. My converted time (from the screen
output) 12/25/2011 is -877432832. And when the drill-down is done it
shows that Christmas is either in 1997 or 1942.

Thoughts?

On Oct 16, 5:11 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 The value from the JavaScript is in seconds.

 Converted to milliseconds, it does not fit in a 4-byte integer
 (0x*134*_7396F480_), that's why normally longs (8 bytes) are used for
 time stamps.

 You don't really need to convert the values to ints just for the sake of
 a number-to-string conversion.

 Either declare smillis, smillis2 as longs and remove the typecast (to
 see milliseconds):

         final*long*smillis = millis;
         final*long*smillis2 = millis2;

 or divide millis and millis2 by 1000 (to see seconds):

         final int smillis = (int) (millis*  / 1000L*);
         final int smillis2 = (int) (millis2*  / 1000L*);

 -- Kostya

 17.10.2011 0:55, Larry/MavrickProductions ?:









  I am writing a program for my kids to count down to Christmas. I have
  been playing with android programming for a year, read books, look
  online for help, but this one is really got me stumped.

  In the java, I use Time (var) .set(mm, dd, ) and long millis =
  (var) .toMillis(true) to convert 12/25/2011 to milliseconds from the
  epoch. According 
  tohttp://www.esqsoft.com/javascript_examples/date-to-epoch.htm,
  12/25/2011 should equal 1324789200. But when I look at the converted
  result in the test window (I added code to show the long results
  before the human readable) it shows 12/25/2011 as -877432832.

  My code is below. I'm sure that I'm missing something simple/stupid.
  Any help is greatly appreciated!!

  Best, -Larry

  ### CODE BELOW ###

  package com.mavrick.countdowntester3;

  import java.util.concurrent.TimeUnit;
  import android.app.Activity;
  import android.os.Bundle;
  import android.os.CountDownTimer;
  import android.text.format.Time;
  import android.widget.TextView;

  public class counttime extends Activity {
     private TextView mTextField;
     private Time TimerSet;
       /** Called when the activity is first created. */
       @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.main);

           final TextView mTextField = (TextView)
  findViewById(R.id.textView1);

           Time TimerSet = new Time();
             TimerSet.set(12, 25, 2011);  // set the date to Dec 25, 2011,
  12am
             TimerSet.normalize(true);
             long millis = TimerSet.toMillis(true);

             Time TimeNow = new Time();
             TimeNow.setToNow();  // set the date to Current Time
             TimeNow.normalize(true);
             long millis2 = TimeNow.toMillis(true);

             long millisset = millis - millis2;   //subtract current from
  future to set the time remaining

             final int smillis = (int) (millis);  //convert long to integer to
  display conversion results
             final int smillis2 = (int) (millis2);

           new CountDownTimer(millisset, 1000) {
              public void onTick(long millisUntilFinished) {

                      // decompose difference into days, hours, minutes and
  seconds parts
                      int weeks   = (int) ((millisUntilFinished / 1000) /
  604800);
                      int days    = (int) ((millisUntilFinished / 1000) / 
  86400);
                      int hours   = (int) (((millisUntilFinished / 1000) - 
  (days
  * 86400)) / 3600);
                      int minutes = (int) (((millisUntilFinished / 1000) - 
  ((days
  * 86400) + (hours * 3600))) / 60);
                      int seconds = (int) ((millisUntilFinished / 1000) % 60);
                      int millicn = (int) (millisUntilFinished / 1000);

                      //write the data: future time, current time, remaining
  time, then human readable

                      mTextField.setText(smillis +       + smillis2 +      
   +
  millicn + Time remaining:  + weeks +   + days +   + hours +  
  + minutes +   + seconds);
                }

                public void onFinish() {
                    mTextField.setText(done!);
                }
             }.start();
           }
  }

 --
 Kostya Vasilyev

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


Re: [android-developers] Re: Time/CountDownTimer: Wrong millis returned for date/time - HELP PLEASE!!

2011-10-16 Thread Kostya Vasilyev


17.10.2011 1:26, Larry/MavrickProductions ?:

Thank you both for the replies!

Actually, the strings are not the problem. The human date/time to
millisecond conversions are wrong.

12/25/2011 should equal 1324789200.


In seconds, yes.

In milliseconds, no, it's 1324789200 * 1000 which does not fit in a 
4-byte integer.


http://www.timestampconvert.com http://www.timestampconvert.com/


My converted time (from the screen
output) 12/25/2011 is -877432832. And when the drill-down is done it
shows that Christmas is either in 1997 or 1942.

Thoughts?


--
Kostya Vasilyev

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

[android-developers] Re: Time/CountDownTimer: Wrong millis returned for date/time - HELP PLEASE!!

2011-10-16 Thread Larry/MavrickProductions
Found part of the problem: My time set line:
TimerSet.set(12, 25, 2011);  // set the date to Dec 25, 2011, 12AM
was backwards - it should have been (25, 12, 2011). Once fixed, the
numbers are a lot closer, but still off by 36 days.
Still looking for help on where I've made a stupid math/code error.
Appreciate the replies!
Best, -Larry

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


[android-developers] Re: VoiceRecognition.java

2011-10-16 Thread D_R_W
TreKing http://sites.google.com/site/rezmobileapps/treking,

Thanks for pushing me her to clarify.

I'm wondering if there is a setting to add the commas to the results during 
the Voice Recognition process or if I need to code post VR process.  Thanks!

DRW

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

[android-developers] Re: Android Tablet Internal Storage

2011-10-16 Thread ramya
oh ok..sounds good..will try this..thanks man:)

On Oct 13, 11:33 pm, Studio LFP studio@gmail.com wrote:
 See if this helps out:

 StatFs sfStats = new StatFs( this.getFilesDir().toString() );
 Log.i( SpaceCheck, Free (bytes):  + ( sfStats.getAvailableBlocks() *
 sfStats.getBlockSize() ) );

 That should get you the directory to the applications internal storage
 (hidden from the user unless rooted) and tell you how much available room
 there is in that location.

 Here's links to the API documents for those:

 http://developer.android.com/reference/android/os/StatFs.htmlhttp://developer.android.com/reference/android/content/Context.html#g...

 Steven
 Studio LFPhttp://www.studio-lfp.com







 On Thursday, October 13, 2011 8:19:04 AM UTC-5, ramya wrote:

  Hi,
  1)I am converting an ipad project to android.In doing so,in ipad
  version ,I can save the internal files in bundle (called Bundle
  directory) and all the files are stored under documents which is
  internal to app.

  In android we have /data/data/{package name}/files

  My Question is I should be able to store large data inside the
  internal storage.Does tablet have large internal space ?I dont want to
  save the files in sdcard either because it can be replaced or
  something.

  Is the device RAM used for internal storage of files?I am facing a
  memory problem where as in ios we can have sufficient data stored in
  sandbox...I need to copy files from assets to in internal storage
  during run time(by files I mean large files).

  Can somebody throw light on this.

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


[android-developers] Re: listview adapter. Recycle bitmap

2011-10-16 Thread Studio LFP
Based on the code there, you wouldn't have the chance to recycle the bitmap 
as you don't keep a handle to it anywhere.

Then again, if the ListView discards that particular row and you aren't 
retaining any handles to the bitmap, then the bitmap should be scheduled for 
collection by the GC. If you did try to retrieve the view that was holding 
the image from the ListView and it did return it to you, there is a good 
chance the ListView still wants to use it and you would not want to release 
the bitmap.

Is there a reason you are wanting to try to recycle the bitmap?

Also, we are talking about the recycle() function on bitmap and not reusing 
the same bitmap, correct?

Steven
Studio LFP
http://www.studio-lfp.com


On Sunday, October 16, 2011 4:14:48 AM UTC-5, emanuele wrote:

 Hello guys.. that s my baseAdapter getview implmentation: 

 @Override 
 public View getView(int position, View convertView, ViewGroup parent) 
 { 

 int type = getItemViewType(position); 
 if (convertView == null) { 
 switch (type) { 
 case TYPE_BIG_NEWS: 
 convertView = mInflater.inflate(R.layout.big_news, null); 
 break; 
 case TYPE_NORMAL_NEWS: 
 convertView = mInflater.inflate(R.layout.normal_news, null); 
 break; 
 default: 
 break; 
 } 
 } 

 ImageView thumb = (ImageView) 
 convertView.findViewById(R.id.thumbId); 




 File f = null; 
 if (filename != null) 
 f = mFileCache.getFile(i.newsKey, filename); 
 if (f == null) { 
 if (mGetThumbsThread != null  filename != null) { 
 Log.i(TAG, cache miss); 
 thumbLinks.offer(new ThumbRequest(i.newsKey, i.thumbLink, 
 i.thumbName)); 
 mGetThumbsThread.signal(); 
 } 
 thumb.setImageResource(placeHolder); 
 } else { 
 Log.i(TAG, 
 file bitmap cached:  + f.getName() +  size:  + f.length() / 
 1024); 
 bitmap = BitmapFactory.decodeFile(f.getAbsolutePath()); 
 thumb.setImageBitmap(bitmap); 
 } 

 return convertView; 
 } 


 Every row is compound of text and an ImageView. Is there any chance to 
 recycle the bitmap I use in the getView?

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

[android-developers] Re: listview adapter. Recycle bitmap

2011-10-16 Thread IcedNet
You should look into Romain Guy's 2009/10 Google I/O presentations on
UI -- he is the whip with ListViews/UI.
If you're looking for what I think you're looking to do -- which is
speed up that list view -- he has a view holder pattern that will do
just that.

Peace,
Dan

On Oct 16, 10:08 pm, Studio LFP studio@gmail.com wrote:
 Based on the code there, you wouldn't have the chance to recycle the bitmap
 as you don't keep a handle to it anywhere.

 Then again, if the ListView discards that particular row and you aren't
 retaining any handles to the bitmap, then the bitmap should be scheduled for
 collection by the GC. If you did try to retrieve the view that was holding
 the image from the ListView and it did return it to you, there is a good
 chance the ListView still wants to use it and you would not want to release
 the bitmap.

 Is there a reason you are wanting to try to recycle the bitmap?

 Also, we are talking about the recycle() function on bitmap and not reusing
 the same bitmap, correct?

 Steven
 Studio LFPhttp://www.studio-lfp.com







 On Sunday, October 16, 2011 4:14:48 AM UTC-5, emanuele wrote:

  Hello guys.. that s my baseAdapter getview implmentation:

  @Override
  public View getView(int position, View convertView, ViewGroup parent)
  {

  int type = getItemViewType(position);
  if (convertView == null) {
  switch (type) {
  case TYPE_BIG_NEWS:
  convertView = mInflater.inflate(R.layout.big_news, null);
  break;
  case TYPE_NORMAL_NEWS:
  convertView = mInflater.inflate(R.layout.normal_news, null);
  break;
  default:
  break;
  }
  }

  ImageView thumb = (ImageView)
  convertView.findViewById(R.id.thumbId);

  File f = null;
  if (filename != null)
  f = mFileCache.getFile(i.newsKey, filename);
  if (f == null) {
  if (mGetThumbsThread != null  filename != null) {
  Log.i(TAG, cache miss);
  thumbLinks.offer(new ThumbRequest(i.newsKey, i.thumbLink,
  i.thumbName));
  mGetThumbsThread.signal();
  }
  thumb.setImageResource(placeHolder);
  } else {
  Log.i(TAG,
  file bitmap cached:  + f.getName() +  size:  + f.length() /
  1024);
  bitmap = BitmapFactory.decodeFile(f.getAbsolutePath());
  thumb.setImageBitmap(bitmap);
  }

  return convertView;
  }

  Every row is compound of text and an ImageView. Is there any chance to
  recycle the bitmap I use in the getView?

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


[android-developers] Re: Add Admob in PreferenceScreen at LiveWallpaper setting screen

2011-10-16 Thread Perry168
I am very upset. The Admob haven't come out too.

On 10月17日, 上午12時35分, Kostya Vasilyev kmans...@gmail.com wrote:
 The listview is taking the entire activity width and height (because of
 fill_parent), so the AdMob view is there, but is pushed beyond the
 edge of the screen.

 Try this on the listview:

 android:layout_height=fill_parent
 android:layout_height=0px
 android:layout_weight=1

 And specify orientation=vertical on the LinearLayout: the default is
 horizontal, meaning the AdMob view is pushed to the right.

 And probably change the width to fill_parent on the AdMob view as well.

 -- Kostya

 16.10.2011 20:19, Perry168 пишет:





  Hi all,

  Following is my new layout Admob XML file. And I use setContentView to
  call this layout in PreferenceActivity. But I don't know why the Admob
  can't show out.
  Who can teach me what's my wrong?
  It make me crazy because I wasted 2 days in this problem.

  LinearLayout
             android:layout_height=fill_parent
             android:layout_width=fill_parent
             xmlns:ads=http://schemas.android.com/apk/lib/com.google.ads;
             xmlns:android=http://schemas.android.com/apk/res/android;

  ListView android:id=@android:id/list
                 android:layout_width=fill_parent
                 android:layout_height=fill_parent /

  com.google.ads.AdView android:id=@+id/ad
             android:layout_width=wrap_content
             android:layout_height=70.0dip
             ads:adSize=BANNER
             ads:adUnitId=my Admob ID
             ads:loadAdOnCreate=true /

  /LinearLayout

 --
 Kostya Vasilyev- 隱藏被引用文字 -

 - 顯示被引用文字 -

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


[android-developers] Re: Time/CountDownTimer: Wrong millis returned for date/time - HELP PLEASE!!

2011-10-16 Thread Studio LFP
Simple, they caught us all looking. Check out the API docs:

http://developer.android.com/reference/android/text/format/Time.html#set%28int,%20int,%20int%29

And notice this part:

*month the zero-based month number (in the range [0,11])*

Took me a second to find this, but December is 11, not 12 like we think 
about it.

Tricky Android dev team!

Steven
Studio LFP
http://www.studio-lfp.com


On Sunday, October 16, 2011 4:38:17 PM UTC-5, Larry/MavrickProductions 
wrote:

 Found part of the problem: My time set line: 
 TimerSet.set(12, 25, 2011);  // set the date to Dec 25, 2011, 12AM 
 was backwards - it should have been (25, 12, 2011). Once fixed, the 
 numbers are a lot closer, but still off by 36 days. 
 Still looking for help on where I've made a stupid math/code error. 
 Appreciate the replies! 
 Best, -Larry 



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

Re: [android-developers] Re: Add Admob in PreferenceScreen at LiveWallpaper setting screen

2011-10-16 Thread Nikolay Elenkov
On Mon, Oct 17, 2011 at 11:44 AM, Perry168 perry...@gmail.com wrote:
 I am very upset. The Admob haven't come out too.


Too bad :) Consider that your users will open the preferences activity
at most a couple of times. Displaying ads there would serve little
purpose other than to annoy people. In short: don't.

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


Re: [android-developers] Re: Time/CountDownTimer: Wrong millis returned for date/time - HELP PLEASE!!

2011-10-16 Thread Nikolay Elenkov
On Mon, Oct 17, 2011 at 11:54 AM, Studio LFP studio@gmail.com wrote:

 month the zero-based month number (in the range [0,11])

 Took me a second to find this, but December is 11, not 12 like we think
 about it.

 Tricky Android dev team!


That comes from java.util.Calendar/Date which have won multiple 'worst
API ever'
awards over the years.

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


[android-developers] Re: Time/CountDownTimer: Wrong millis returned for date/time - HELP PLEASE!!

2011-10-16 Thread Larry/MavrickProductions
WOW!!

I read that well over a dozen times and didn't catch that until you
both pointed it out. Now it works just fine.

THANK YOU!!! Really appreciate the assist!

Best, -Larry

On Oct 16, 11:09 pm, Nikolay Elenkov nikolay.elen...@gmail.com
wrote:
 On Mon, Oct 17, 2011 at 11:54 AM, Studio LFP studio@gmail.com wrote:

  month the zero-based month number (in the range [0,11])

  Took me a second to find this, but December is 11, not 12 like we think
  about it.

  Tricky Android dev team!

 That comes from java.util.Calendar/Date which have won multiple 'worst
 API ever'
 awards over the years.

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


[android-developers] timer for implementing projectile motion

2011-10-16 Thread ruchira
Can anyone please suggest me the type of android's predefined  timer
to be used for implementing projectile motion or do I need to write a
custom timer.Also please let me know  the range of initial velocity V
which can be used for assumption.

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


[android-developers] List View Focus Problem!

2011-10-16 Thread abi
Hi,

I have a list view and a bottom bar in a layout. I can't focus the
bottom bar after focusing the list view.
How to find focus lost from list view. At that time I need to focus
that bottom bar.

Please Suggest...

Regards,
Abi

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


[android-developers] Re: List View Focus Problem!

2011-10-16 Thread Studio LFP
This might be helpful:

http://developer.android.com/reference/android/view/View.html#setOnFocusChangeListener%28android.view.View.OnFocusChangeListener%29

You can create one or implement it on your activity and link as many views 
to it as you want. You should receive an event for focus gained and lost.

Steven
Studio LFP
http://www.studio-lfp.com


On Sunday, October 16, 2011 11:27:16 PM UTC-5, abi wrote:

 Hi, 

 I have a list view and a bottom bar in a layout. I can't focus the 
 bottom bar after focusing the list view. 
 How to find focus lost from list view. At that time I need to focus 
 that bottom bar. 

 Please Suggest... 

 Regards, 
 Abi

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