Re: [android-developers] How to change Format of the Facebook SDK "Created_Time"

2016-02-23 Thread Ralph Bergmann | the4thFloor.eu

Am 23.02.16 um 16:26 schrieb Mark van Limburg:

According to the earlier pasted Class file, where would you paste the
SimpleDataFormat code?



You have this 2 lines in your code

   feeds.add(pagefeed.getJSONObject(l).getString("created_time"));
   feeds.add(pagefeed.getJSONObject(l).getString("message"));

changed it to something like this:

SimpleDateFormat formatIn = new SimpleDateFormat("dd-MM-", 
Locale.ENGLISH);
SimpleDateFormat formatOut = new SimpleDateFormat("-MM-dd", 
Locale.ENGLISH);


String created_time = 
pagefeed.getJSONObject(l).getString("created_time");

Date date = formatIn.parse(created_time);

feeds.add(formatOut.format(date));
feeds.add(pagefeed.getJSONObject(l).getString("message"));

--
You received this message because you are subscribed to the Google Groups "Android 
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/56CC96D8.7040107%40the4thfloor.eu.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] How to change Format of the Facebook SDK "Created_Time"

2016-02-23 Thread Ralph Bergmann | the4thFloor.eu

Am 23.02.16 um 15:22 schrieb Mark van Limburg:

Can someone help me where i should post the code and what kind of code
for using simple date format?



You can use Androids SimpleDateFormat to parse the date

http://developer.android.com/reference/java/text/SimpleDateFormat.html

If you need more try https://github.com/JakeWharton/ThreeTenABP

--
You received this message because you are subscribed to the Google Groups "Android 
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/56CC75D1.1060007%40the4thfloor.eu.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Use gradle variable in java (Android Studio)

2016-01-27 Thread Ralph Bergmann | the4thFloor.eu
Am 27.01.16 um 17:03 schrieb Adrian Ivasku:
> I have in my gradle file something like :
> 
> String packageName = com.test.free
> 
> 
>  Now I want this String packageName to use in my java class.

You can access the packageName from your app with BuildConfig.APPLICATION_ID

For your own varaiables you can use:

// for resources
resValue "string", "", ""

// for Java fields in BuildConfig
buildConfigField "String", "_AUTHORITY", ""

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/56A94FF0.9070906%40the4thfloor.eu.
For more options, visit https://groups.google.com/d/optout.


Re: Future of ADT

2015-05-26 Thread Ralph Bergmann | the4thFloor.eu
Am 11.05.15 um 17:55 schrieb Massimo Montecchi:
 Please, maintain ADT in a working state for future versions of Eclipse.

see https://github.com/eclipse/andmore and
http://www.vogella.com/tutorials/EclipseGradle/article.html

-- 
You received this message because you are subscribed to the Google Groups 
adt-dev group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adt-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to connect a mobile app (Android/iOS) with a Spark backend?

2015-02-18 Thread Ralph Bergmann | the4thFloor.eu
Hi,


I have dependency problems to use spark-core inside of a HttpServlet
(see other mail from me).

Maybe I'm wrong?!

What I want to do: I develop a mobile app (Android and iOS) and want to
connect them with Spark on backend side.

To do this I want to use Tomcat. The app uses https to ask Tomcat for
the needed data and Tomcat asks Spark.

Is this the right way? Or is there a better way to connect my mobile
apps with the Spark backend?

I hope that I'm not the first one who want to do this.



Ralph



signature.asc
Description: OpenPGP digital signature


Re: How to connect a mobile app (Android/iOS) with a Spark backend?

2015-02-18 Thread Ralph Bergmann | the4thFloor.eu
Hi,


Am 18.02.15 um 15:58 schrieb Sean Owen:
 That said, it depends a lot on what you are trying to do. What are you
 trying to do? You just say you're connecting to spark.

There are 2 tasks I want to solve with Spark.

1) The user opens the mobile app. The app sends a pink to the backend.
When this happens the backend has to collect some data from other server
via http and has to do some stuff with this data.

2) The mobile app can download this data from 1. In this case the
backend has to find/create the right data (depending on user location,
rating, etc.)


Ralph



signature.asc
Description: OpenPGP digital signature


Berlin Apache Spark Meetup

2015-02-17 Thread Ralph Bergmann | the4thFloor.eu
Hi,


there is a small Spark Meetup group in Berlin, Germany :-)
http://www.meetup.com/Berlin-Apache-Spark-Meetup/

Plaes add this group to the Meetups list at
https://spark.apache.org/community.html


Ralph

-
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org



spark-core in a servlet

2015-02-17 Thread Ralph Bergmann | the4thFloor.eu
Hi,


I want to use spark-core inside of a HttpServlet. I use Maven for the
build task but I have a dependency problem :-(

I get this error message:

ClassCastException:
com.sun.jersey.server.impl.container.servlet.JerseyServletContainerInitializer
cannot be cast to javax.servlet.ServletContainerInitializer

When I add this exclusions it builds but than there are other classes
not found at runtime:

  dependency
 groupIdorg.apache.spark/groupId
 artifactIdspark-core_2.11/artifactId
 version1.2.1/version
 exclusions
exclusion
   groupIdorg.apache.hadoop/groupId
   artifactIdhadoop-client/artifactId
/exclusion
exclusion
   groupIdorg.eclipse.jetty/groupId
   artifactId*/artifactId
/exclusion
 /exclusions
  /dependency


What can I do?


Thanks a lot!,

Ralph

-- 

Ralph Bergmann

iOS and Android app developer


www  http://www.the4thFloor.eu

mail ra...@the4thfloor.eu
skypedasralph

google+  https://plus.google.com/+RalphBergmann
xing https://www.xing.com/profile/Ralph_Bergmann3
linkedin https://www.linkedin.com/in/ralphbergmann
gulp https://www.gulp.de/Profil/RalphBergmann.html
github   https://github.com/the4thfloor


pgp key id   0x421F9B78
pgp fingerprint  CEE3 7AE9 07BE 98DF CD5A E69C F131 4A8E 421F 9B78
project
   xmlns=http://maven.apache.org/POM/4.0.0;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd;
   modelVersion4.0.0/modelVersion

   nameSparkWordCount/name
   version1.0-SNAPSHOT/version
   groupIdeu.the4thfloor/groupId
   artifactIdSparkWordCount/artifactId
   packagingwar/packaging
   urlhttp://maven.apache.org/url

   properties
  jdk.version1.7/jdk.version
   /properties

   dependencies
  dependency
 groupIdjunit/groupId
 artifactIdjunit/artifactId
 version4.11/version
 scopetest/scope
  /dependency
  dependency
 groupIdjavax.servlet/groupId
 artifactIdjavax.servlet-api/artifactId
 version3.1.0/version
 scopeprovided/scope
  /dependency
  dependency
 groupIdorg.apache.spark/groupId
 artifactIdspark-core_2.11/artifactId
 version1.2.1/version
 exclusions
exclusion
   groupIdorg.apache.hadoop/groupId
   artifactIdhadoop-client/artifactId
/exclusion
exclusion
   groupIdorg.eclipse.jetty/groupId
   artifactId*/artifactId
/exclusion
 /exclusions
  /dependency
   /dependencies

   build
  finalNameSparkWordCount/finalName
  plugins
 !-- Eclipse project --
 plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-eclipse-plugin/artifactId
version2.9/version
configuration
   !-- Always download and attach dependencies source code --
   downloadSourcestrue/downloadSources
   downloadJavadocsfalse/downloadJavadocs
   !-- Avoid type mvn eclipse:eclipse -Dwtpversion=2.0 --
   wtpversion2.0/wtpversion
/configuration
 /plugin
 !-- Set JDK Compiler Level --
 plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-compiler-plugin/artifactId
version2.3.2/version
configuration
   source${jdk.version}/source
   target${jdk.version}/target
/configuration
 /plugin
 !-- For Maven Tomcat Plugin --
 plugin
groupIdorg.apache.tomcat.maven/groupId
artifactIdtomcat7-maven-plugin/artifactId
version2.2/version
configuration
   path/SparkWordCount/path
/configuration
 /plugin
  /plugins
   /build
/project

signature.asc
Description: OpenPGP digital signature


[android-developers] Network Service Discovery discovers nothing on Android L

2014-09-28 Thread Ralph Bergmann | the4thFloor.eu
Hello,


I played a little bit with this example:
http://developer.android.com/training/connect-devices-wirelessly/nsd.html

But on Android L it discovers nothing. The same code on KitKat discovers
the expected services.

Is this a know issue? I found nothing about it at
https://code.google.com/p/android/issues and opened a new ticket:
https://code.google.com/p/android/issues/detail?id=76796


Ralph

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


Re: [android-developers] Screencast in Android

2014-08-22 Thread Ralph Bergmann | the4thFloor.eu
Am 21.08.14 um 19:14 schrieb Rahul Raja:
 Hey 
 Is there a good app or method by which i can make a screencast for one of my
 Android application?

http://developer.android.com/tools/help/adb.html#screenrecord



signature.asc
Description: OpenPGP digital signature


Re: [android-developers] TextView maxLines based on height

2014-02-15 Thread Ralph Bergmann | the4thFloor.eu
Am 13.02.14 03:54, schrieb Ankur Avlani:
 Can someone please suggest me some faster was to achieve my requirement.

try this one:

/**
 * Calculates the lines needed to show the text.
 *
 * @param paint
 *   the TextPaint from the TextView
 * @param text
 *   the text for the calculation
 * @param textAppearance
 *   text typeface, size, and style
 * @param avail
 *   the available width
 * @return the number of lines needed to show the text
 */
public static int neededLines(final TextPaint paint, final String text,
final TextAppearanceSpan textAppearance, final int avail) {

   if (TextUtils.isEmpty(text)) {
  return 0;
   }

   final TextPaint textPaint = new TextPaint();
   textPaint.set(paint);

   textPaint.setTextSize(textAppearance.getTextSize());
   textPaint.setTypeface(Typeface.create(textAppearance.getFamily(),
textAppearance.getTextStyle()));

   final StaticLayout layout = new StaticLayout(text, textPaint, avail,
Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
   final int lineCount = layout.getLineCount();

   return lineCount;
}



Ralph



signature.asc
Description: OpenPGP digital signature


[android-developers] Notification with TaskStackBuilder.getPendingIntent() is not open the Activity on Nexus7 2012 with KitKat

2013-12-06 Thread Ralph Bergmann | the4thFloor.eu
Hello,


I have a problem to open a activity from a notification with a
PendingIntent from a TaskStackBuilder.

See this bug report:
https://code.google.com/p/android/issues/detail?id=63236

Has anyone run into the same problem?



Ralph



signature.asc
Description: OpenPGP digital signature


[android-developers] Adding Fragments to a LinearLayout programmatically

2013-08-30 Thread Ralph Bergmann | the4thFloor.eu
I am trying to add nested child Fragments into a parent Fragment.

All works fine but

At first my code:

public class FragmentDatasheetWithHeader extends Fragment {


   private long   mRowId;
   private String mSid;


   @Override
   public View onCreateView(final LayoutInflater inflater, final
ViewGroup container, final Bundle savedInstanceState) {

  final ScrollView scrollView = new ScrollView(getActivity());
  final LinearLayout linearLayout = new LinearLayout(getActivity());
  linearLayout.setId(4711);
  linearLayout.setOrientation(LinearLayout.VERTICAL);

  scrollView.addView(linearLayout);

  createUI();

  return scrollView;
   }

   private void createUI() {

  final FragmentProductDetailHeader fragmentHeader =
FragmentProductDetailHeader.newInstance(this.mRowId,
FragmentProductDetailHeader.HEADERTYPE_SMALL);
  final FragmentDatasheet fragmentDatasheet =
FragmentDatasheet.newInstance(this.mRowId, this.mSid);

  final FragmentManager fragmentManager = getChildFragmentManager();
  fragmentManager.beginTransaction().add(4711, fragmentHeader,
fragmentHeader).commit();
  fragmentManager.beginTransaction().add(4711, fragmentDatasheet,
fragmentDatasheet).commit();
   }
}

Now my problem:

In the Developer options I activated Don't keep activities (Destroy
every activity as soon the user leaves it)

When the activity with the FragmentDatasheetWithHeader is open and the
app goes into background and comes back to foreground the nested
Fragments are doubled. But it only appears if the container for the
nested Fragments is a LinearLayout. If the container is a FrameLayout
the nested Fragments are not doubled.

What's going wrong?


Ralph

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


Re: [android-developers] Adding Fragments to a LinearLayout programmatically

2013-08-30 Thread Ralph Bergmann | the4thFloor.eu
Am 31.08.13 02:02, schrieb TreKing:
 1 - Debug your app and gather more information.

I debugged it. The createUI() method is called once.



Ralph

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


[android-developers] ShareActionProvider: How to overwrite sharing behaviour?

2013-07-25 Thread Ralph Bergmann | the4thFloor.eu

Hello,


I can add a OnShareTargetSelectedListener to the ShareActionProvider to 
get notified if a share target is selected (boolean 
onShareTargetSelected (ShareActionProvider source, Intent intent)).


public abstract boolean onShareTargetSelected (ShareActionProvider 
source, Intent intent)


Called when a share target has been selected. The client can decide 
whether to perform some action before the sharing is actually performed.


Note: Modifying the intent is not permitted and any changes to the 
latter will be ignored.


Note: You should not handle the intent here. This callback aims to 
notify the client that a sharing is being performed, so the client can 
update the UI if necessary.


Parameters
source  The source of the notification.
intent  The intent for launching the chosen share target.
Returns
The return result is ignored. Always return false for consistency.


What I not understand: How to overwrite the sharing behaviour?

I think the method has to return true if the intent is handled and 
should not be delivered to clients.


But the method returns always false :-(


Ralph

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

To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] ShareActionProvider: How to overwrite sharing behaviour?

2013-07-25 Thread Ralph Bergmann | the4thFloor.eu
I forgot, the documentaion of the 
ShareActionProvider.setOnShareTargetSelectedListener method says:


The listener can optionally decide to handle the selection and not rely 
on the default behavior which is to launch the activity.



But how to do this?


Ralph


Am 25.07.13 18:20, schrieb Ralph Bergmann | the4thFloor.eu:

Hello,


I can add a OnShareTargetSelectedListener to the ShareActionProvider to
get notified if a share target is selected (boolean
onShareTargetSelected (ShareActionProvider source, Intent intent)).

public abstract boolean onShareTargetSelected (ShareActionProvider
source, Intent intent)

Called when a share target has been selected. The client can decide
whether to perform some action before the sharing is actually performed.

Note: Modifying the intent is not permitted and any changes to the
latter will be ignored.

Note: You should not handle the intent here. This callback aims to
notify the client that a sharing is being performed, so the client can
update the UI if necessary.

Parameters
sourceThe source of the notification.
intentThe intent for launching the chosen share target.
Returns
The return result is ignored. Always return false for consistency.


What I not understand: How to overwrite the sharing behaviour?

I think the method has to return true if the intent is handled and
should not be delivered to clients.

But the method returns always false :-(


Ralph




--

Ralph Bergmann

iOS and Android app developer


www  http://www.the4thFloor.eu | http://www.dasralph.de

mail ra...@the4thfloor.eu
skypedasralph

xing https://www.xing.com/profile/Ralph_Bergmann3
linkedin https://www.linkedin.com/in/ralphbergmann
gulp https://www.gulp.de/Profil/RalphBergmann.html
github   https://github.com/the4thfloor

java user group  http://www.jug-bb.de | https://www.xing.com/net/jugbb
ios dev grouphttps://www.xing.com/net/iosberlin

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

To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] VM does not provide monitor information

2013-07-21 Thread Ralph Bergmann | the4thFloor.eu
Hello,


I want to debug my app but when a breakpoint is reached I got this
message: VM does not provide monitor information

What's wrong?



Ralph

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




Re: [android-developers] Re: Updated to ADT 22: 'R cannot be resolved to a variable'

2013-05-16 Thread Ralph Bergmann | the4thFloor.eu

Am 16.05.13 11:18, schrieb BoD:

Indeed if I look inside the 'gen' folder, nothing is there.


I had the problem too, there is a new Android SDK Bild-tools. Open the 
Android SDK Manager and make a update, maybe twice.



Ralph

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

To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: String.replaceAll with regular expression

2013-04-07 Thread Ralph Bergmann | the4thFloor.eu
Am 07.04.13 09:34, schrieb Lew:
 Ralph Bergmann wrote:
 Caused by: java.util.regex.PatternSyntaxException: Invalid value for
 match mode flags near index 4:
 (?w=[0-9]+)
 ^

I found it, the problem is the ? at the beginning. It is also a regex
metacharacter.
([?]w=[0-9]+) works :-)


Ralph

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




[android-developers] String.replaceAll with regular expression

2013-04-06 Thread Ralph Bergmann | the4thFloor.eu
Hello,


I want to replace parts of a string but get an error :-(

The code:

String reSiezedURL = foo;

reSiezedURL = reSiezedURL.replaceAll((?w=[0-9]+),
String.format(?w=%d, this.reqWidth));
reSiezedURL = reSiezedURL.replaceAll((w=[0-9]+),
String.format(w=%d, this.reqWidth));
reSiezedURL = reSiezedURL.replaceAll((?h=[0-9]+),
String.format(?h=%d, this.reqHeight));
reSiezedURL = reSiezedURL.replaceAll((h=[0-9]+),
String.format(h=%d, this.reqHeight));

The error:

Caused by: java.util.regex.PatternSyntaxException: Invalid value for
match mode flags near index 4:
(?w=[0-9]+)
^
at java.util.regex.Pattern.compileImpl(Native Method)
java.util.regex.Pattern.compile(Pattern.java:407)
at java.util.regex.Pattern.init(Pattern.java:390)
at java.util.regex.Pattern.compile(Pattern.java:381)
at java.lang.String.replaceAll(String.java:1774)

The question:

What is wrong with my regular expression?


Regards, Ralph

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




[android-developers] reusing AsyncTaskLoader with always fresh data

2013-04-03 Thread Ralph Bergmann | the4thFloor.eu

Hello,


I wont to reuse my AsyncTaskLoader. To do it I call:

LoaderResult loader = getLoaderManager().initLoader(0, args, this);
loader.startLoading();

In this startLoading method is a if-statment:

if (info.mHaveData  mStarted) {
   // If the loader has already generated its data, report it now.
   info.callOnLoadFinished(info.mLoader, info.mData);
}
(http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.2.2_r1/android/app/LoaderManager.java#616)


The mStarted flag indicate that the LoaderManager of the activity is 
started.


And the info.mHaveData flag indicate that the loader has data or not 
from a previous run.


My problem / question: How can I reset the loader after a previous run 
that it lose its data and info.mHaveData is false? Because I get the 
onLoadFinished call twice and the first one is wrong :-(



Ralph

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

To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: reusing AsyncTaskLoader with always fresh data

2013-04-03 Thread Ralph Bergmann | the4thFloor.eu

Am 03.04.13 15:37, schrieb Streets Of Boston:

The call to getLoaderManager().initLoader(0, args, this);  is enough
 to have your Loader run at least the first time it is created. Do
*not *call 'startLoading()'.


yeah... reading helps :-)


startLoading()
This function will normally be called for you automatically by
LoaderManager when the associated fragment/activity is being
started.



If you want to refresh your Loader's data call
getLoaderManager().*restart*Loader(0, args, this);


that works too :-)


Thanks a lo,
Ralph

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

To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] google map problem

2012-11-28 Thread Ralph Bergmann | the4thFloor.eu

Am 20.11.12 15:14, schrieb doğan:

I want to use google map api .But i have problem about show the
coordinates.I added a screencast and some part of codes.Any idea this
problem?


do you use the right Maps Api key?

https://developers.google.com/android/maps-api-signup

You need one for development and one for the release build.


Ralph

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: HttpURLConnection on Galaxy Nexus 4.2

2012-11-28 Thread Ralph Bergmann | the4thFloor.eu

Am 27.11.12 11:40, schrieb Fritjof:

Integer.parseInt(Build.VERSION.SDK)  13)


why you parse a int to Integer and let it automatically convert 
(unboxing) to int?


http://javarevisited.blogspot.de/2012/07/auto-boxing-and-unboxing-in-java-be.html


Ralph

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: You need to enter a valid Youtube address.

2012-11-19 Thread Ralph Bergmann | the4thFloor.eu

Am 19.11.12 09:39, schrieb Keith Wiley:

I also tried the youtube short URL, btw, i.e.,
http://youtu.be/XXX .
http://youtu.be/KmBVrga0mGw


I have added this video with success 
http://www.youtube.com/watch?v=zHirwKGEfoE



Ralph

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] http post NetworkOnMainThreadException

2012-10-26 Thread Ralph Bergmann | the4thFloor.eu

http://developer.android.com/training/basics/network-ops/connecting.html#AsyncTask


Am 26.10.12 11:38, schrieb Amey Bapat:

On Thu, Oct 25, 2012 at 4:40 PM, aueddonline commsult...@gmail.com
laptop. The webpage outputs some JSON also shown below; However I am
getting a NetworkOnMainThreadException when running the app. I can


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Google Checkout Account

2012-10-24 Thread Ralph Bergmann | the4thFloor.eu

Am 24.10.12 09:27, schrieb katarina:

But when we try to open up a Google Checkout account from Canada it
will not let us do, because only options for addresses are US and UK.
As well as the tax information.


read this:
https://groups.google.com/d/msg/android-developers/CDUCZVQ_PEA/Q-3ohhhD33AJ


Ralph

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] In-app billing for canadian

2012-10-14 Thread Ralph Bergmann | the4thFloor.eu
Am 13.10.12 18:31, schrieb MathieuB:
 to look at implementing in-app billing, when I faced the fact that
 canadian CANNOT open google merchant account... I was a bit shocked.

are you sure?

In-app billing is available to developers in supported locations for
merchants.
https://support.google.com/googleplay/android-developer/bin/answer.py?hl=enanswer=1153481

Supported locations for merchants
Currently, developers in the below countries may register as Google
Checkout merchants and sell paid applications:

Argentina*
Australia
Austria
Belgium
Brazil
Canada
...
https://support.google.com/googleplay/android-developer/bin/answer.py?hl=enanswer=150324

Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] In-app billing for canadian

2012-10-14 Thread Ralph Bergmann | the4thFloor.eu
Am 14.10.12 19:41, schrieb MathieuB:
 Thought the same thing when I read it, they said it clear. But when it's
 time to open a google checkout account so I can receive money, it says
 only available to US and UK...

I have a account in Germany, I think there is something else wrong :-(


Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] PARTIAL_WAKE_LOCK and Android 2.3.x

2012-07-24 Thread Ralph Bergmann | the4thFloor.eu
Hello,


what is the magic with wake locks?

I try to prevent that the phone is going to sleep.

Here my code (snippet):

public class GPSListenerHandler extends Handler implements
GpsStatus.Listener, LocationListener {

   private WakeLock wakeLock;

   protected booleanisWakeLocked;


   public GPSListenerHandler(Looper l, Context c) {

  super(l);

  // ...

  final PowerManager mgr = (PowerManager)
c.getSystemService(Context.POWER_SERVICE);
  this.wakeLock = mgr.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
GPSListener);
   }

   @Override
   public void handleMessage(Message msg) {

  if (msg.arg1 == GPSTrackingService.START) {

 this.wakeLock.acquire();
 this.isWakeLocked = true;

 this.tracking = true;
 startLogging();

  } else if (msg.arg1 == GPSTrackingService.STOP) {

 if (this.isWakeLocked) {
this.wakeLock.release();
 }
 this.tracking = false;
 stopLogging();
  }
   }

   // ...

}

Now my Android 2.3.x devices going to sleep after round about 10
minutes, my 4.x devices stay awake.


What's wrong?


Ralph

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


[android-developers] app crashes when a map view is added

2012-07-21 Thread Ralph Bergmann | the4thFloor.eu
Hello,


on all my Android 4.x devices the app crashes when I restart the app via
Eclipse and the MapView is visible.

You can find a example app here:
https://github.com/the4thfloor/AndroidMapViewCrashTest

Import this project and press play in Eclipse.

In the app press the buttons until the MapView is visible.

Then restart the app with Eclipse and the app crashes with the following
error:

FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate application
android.app.Application: java.lang.NullPointerException
at android.app.LoadedApk.makeApplication(LoadedApk.java:482)
at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:3938)
at android.app.ActivityThread.access$1300(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at
android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:362)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:305)
at android.app.LoadedApk.makeApplication(LoadedApk.java:474)
... 11 more


What's going wrong?



Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] app crashes when a map view is added

2012-07-21 Thread Ralph Bergmann | the4thFloor.eu
Am 21.07.12 19:31, schrieb TreKing:
 As the stacktrace explicitly tells you, you have a NullPointer at line
 482 of LoadedApk.java. Use your debugger to determine what is null, then
 make it not null.

The LoadedApk.java is from the system not from me.

And when you look at the example project the you can see that I only
show a MapView.

There is nothing what I can make wrong.

And the app crashes only if the MapView is the 3rd view. If the MapView
is the 2nd view all works fine.


Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Handling Bitmap Out of Memory Error

2012-07-17 Thread Ralph Bergmann | the4thFloor.eu
Am 17.07.12 09:22, schrieb Francisco M. Marzoa Alonso:
 GC does NOT take care of recycling Bitmaps, so the answer is that YOU
 should do that.

public void recycle ()

... This is an advanced call, and normally need not be called, since the
normal GC process will free up this memory when there are no more
references to this bitmap.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] hierarchy viewer shows nothing/AVDs not being reused

2012-06-21 Thread Ralph Bergmann | the4thFloor.eu
Am 21.06.12 01:29, schrieb nchubrich:
 From what I understand it has to be run through an emulator unless I
 have a developer build on my phone.  But I still don't get any

you can use your phone, take a look at

https://github.com/romainguy/ViewServer



ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] debugging USB Host

2012-06-20 Thread Ralph Bergmann | the4thFloor.eu
Hello,



 When debugging applications that use USB accessory or host features, 
 you most likely will have USB hardware connected to your 
 Android-powered device. This will prevent you from having an adb 
 connection to the Android-powered device via USB. You can still 
 access adb over a network connection. To enable adb over a network 
 connection:
 
 1. Connect the Android-powered device via USB to your computer.
 
 2. From your SDK platform-tools/ directory, enter adb tcpip  at
 the command prompt.
 
 3. Enter adb connect device-ip-address: You should now be
 connected to the Android-powered device and can issue the usual adb
 commands like adb logcat.
 
 4. To set your device to listen on USB, enter adb usb.
(http://developer.android.com/guide/topics/usb/index.html)


But how can I connect my Android device with the USB hardware and with
my computer at the same time?


Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: debugging USB Host

2012-06-20 Thread Ralph Bergmann | the4thFloor.eu
Am 20.06.12 12:01, schrieb Hemanth(ヘマント):
 You can remove the USB cable connected to the host, after step 2.
 Once the port is forwarded, you can connect from the host over WiFi

thanks a lot, it works :-)


Ralph

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


Re: [android-developers] Long press on the Google map secret?

2012-06-17 Thread Ralph Bergmann | the4thFloor.eu
try this:

import java.util.Timer;
import java.util.TimerTask;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;



public class MyLongpressMapView extends MapView {

   public interface OnLongpressListener {

  public void onLongpress(MapView view, GeoPoint longpressLocation);
   }


   /**
* Time in ms before the OnLongpressListener is triggered.
*/
   static final int   LONGPRESS_THRESHOLD = 500;

   /**
* Keep a record of the center of the map, to know if the map
* has been panned.
*/
   private GeoPoint   lastMapCenter;

   private Timer  longpressTimer  =
new Timer();

   private MyLongpressMapView.OnLongpressListener longpressListener;

   private float  offset;


   public MyLongpressMapView(Context context, String apiKey) {

  super(context, apiKey);
   }

   public MyLongpressMapView(Context context, AttributeSet attrs) {

  super(context, attrs);

  this.offset =
context.getResources().getDimension(R.dimen.tabbar_height);
   }

   public MyLongpressMapView(Context context, AttributeSet attrs, int
defStyle) {

  super(context, attrs, defStyle);
   }

   public void
setOnLongpressListener(MyLongpressMapView.OnLongpressListener listener) {

  this.longpressListener = listener;
   }

   /**
* This method is called every time user touches the map,
* drags a finger on the map, or removes finger from the map.
*/
   @Override
   public boolean onTouchEvent(MotionEvent event) {

  handleLongpress(event);

  return super.onTouchEvent(event);
   }

   /**
* This method takes MotionEvents and decides whether or not
* a longpress has been detected. This is the meat of the
* OnLongpressListener.
* The Timer class executes a TimerTask after a given time,
* and we start the timer when a finger touches the screen.
* We then listen for map movements or the finger being
* removed from the screen. If any of these events occur
* before the TimerTask is executed, it gets cancelled. Else
* the listener is fired.
*
* @param event
*/
   private void handleLongpress(final MotionEvent event) {

  if (event.getAction() == MotionEvent.ACTION_DOWN) {

 this.longpressTimer = new Timer();
 this.longpressTimer.schedule(new TimerTask() {

@Override
public void run() {

   final GeoPoint longpressLocation = getProjection()
.fromPixels((int) event.getX(), (int)
(event.getY() - MyLongpressMapView.this.offset));

   if (MyLongpressMapView.this.longpressListener != null) {

MyLongpressMapView.this.longpressListener.onLongpress(MyLongpressMapView.this,
longpressLocation);
   }
}

 },
  LONGPRESS_THRESHOLD);

 this.lastMapCenter = getMapCenter();
  }

  if (event.getAction() == MotionEvent.ACTION_MOVE) {

 if (!getMapCenter().equals(this.lastMapCenter)) {

this.longpressTimer.cancel();
 }

 this.lastMapCenter = getMapCenter();
  }

  if (event.getAction() == MotionEvent.ACTION_UP) {

 this.longpressTimer.cancel();
  }

  if (event.getPointerCount()  1) {

 this.longpressTimer.cancel();
  }
   }
}

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


Re: [android-developers] Long press on the Google map secret?

2012-06-17 Thread Ralph Bergmann | the4thFloor.eu
here the link :-)

http://www.kind-kristiansen.no/2011/android-handling-longpresslongclick-on-map-revisited/

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] QR Code Scaning

2012-06-12 Thread Ralph Bergmann | the4thFloor.eu
Am 07.06.12 15:11, schrieb sujit dubey:
 Is there Way to include qr code scaning in app without using zxing
 library, as a standalone app, with ui of my choice

http://android-developers.blogspot.de/2012/02/share-with-intents.html

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


Re: [android-developers] Svg to hdpi, mdpi, ldpi

2012-06-02 Thread Ralph Bergmann | the4thFloor.eu
Am 02.06.12 00:31, schrieb Jeremy Villalobos:
 On build, the plugin creates the png's from the svg's, but the svgs are
 not added to the release package.
 
 Is there such a tool ?

http://digitalsquid.co.uk/patchworker/

http://code.google.com/p/svg-android/

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


[android-developers] android:onClick and fragments

2012-05-28 Thread Ralph Bergmann | the4thFloor.eu
Hello,


In the layout of my fragment I have a ImageButton where I use the
android:onClick option.

But when I tap on the button I get this error:

Failed to handle callback; interface not implemented,
callback:android.view.View$PerformClick@410a5308
java.lang.IllegalStateException: Could not find a method close(View) in
the activity class xxx for onClick handler on view class
android.widget.ImageView

Why the callback method must be in the FragmentActivity class and not in
the Fragment class?


Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] SQLiteException: no such table

2012-05-24 Thread Ralph Bergmann | the4thFloor.eu
Hello,


my app was released a year ago or so, but now one year later, I get the
following error message:

android.database.sqlite.SQLiteException: no such table: tracking: ,
while compiling: SELECT _id, ...

How can it happen that the table does not exist? In one installation of
thousands?

The app accesses the db via an SQLiteOpenHelper.

This is my implementation, a little bit shortened:


public class DatabaseHelper extends SQLiteOpenHelper {

   private static final int  DATABASE_VERSION = 22;

   private static final String   DATABASE_NAME= de.sportscheck.db;

   private static DatabaseHelper dh;

   public static synchronized DatabaseHelper singleton(final Context
context) {

  if (dh == null) {
 dh = new DatabaseHelper(context);
  }

  return dh;
   }

   private DatabaseHelper(final Context context) {

  super(context, DATABASE_NAME, null, DATABASE_VERSION);
   }

   @Override
   public void onCreate(SQLiteDatabase db) {

  createTrainingTable(db);
  createTrainingStepTable(db);
  createTrackingTable(db);
  createBreadcrumbTable(db);
  createKmTable(db);
   }

   @Override
   public void onUpgrade(SQLiteDatabase db, int oldVersion, int
newVersion) {

  if (oldVersion == 12) {

 db.execSQL(ALTER TABLE  ...
 db.execSQL(ALTER TABLE  ...
  }

  if (oldVersion == 21) {

 createKmTable(db);
  }
   }

   private void createTrainingTable(SQLiteDatabase db) {

  db.execSQL(DROP TABLE IF EXISTS
.concat(TrainingProvider.TABLE_NAME) + ;);
  String sql = CREATE TABLE .concat(TrainingProvider.TABLE_NAME) ...
   .concat(TrainingItem.TYP).concat( TEXT););
  db.execSQL(sql);
   }

   private void createTrainingStepTable(SQLiteDatabase db) {

  db.execSQL(DROP TABLE IF EXISTS
.concat(TrainingStepProvider.TABLE_NAME) + ;);
  String sql = CREATE TABLE
.concat(TrainingStepProvider.TABLE_NAME) ...
  db.execSQL(sql);
   }

   private void createTrackingTable(SQLiteDatabase db) {

  db.execSQL(DROP TABLE IF EXISTS
.concat(TrackingProvider.TABLE_NAME) + ;);
  String sql = CREATE TABLE .concat(TrackingProvider.TABLE_NAME) ...
  db.execSQL(sql);
   }

   private void createBreadcrumbTable(SQLiteDatabase db) {

  db.execSQL(DROP TABLE IF EXISTS
.concat(BreadcrumbProvider.TABLE_NAME) + ;);
  String sql = CREATE TABLE .concat(BreadcrumbProvider.TABLE_NAME) ...
  db.execSQL(sql);
   }

   private void createKmTable(SQLiteDatabase db) {

  db.execSQL(DROP TABLE IF EXISTS .concat(KmProvider.TABLE_NAME) +
;);
  String sql = CREATE TABLE .concat(KmProvider.TABLE_NAME) ...
  db.execSQL(sql);
   }
}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] java.lang.ClassNotFoundException

2012-05-24 Thread Ralph Bergmann | the4thFloor.eu
Hello,


how can the following error happens? The app was build and exported via
Eclipse. It has over 2300 installations but one user reports this error.

java.lang.RuntimeException: Unable to instantiate application
de.sportscheck.SportScheckApplication: java.lang.ClassNotFoundException:
de.sportscheck.SportScheckApplication
 at android.app.LoadedApk.makeApplication(LoadedApk.java:529)
 at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:4442)
 at android.app.ActivityThread.access$1300(ActivityThread.java:139)
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1305)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loop(Looper.java:154)
 at android.app.ActivityThread.main(ActivityThread.java:4944)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:511)
 at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
 at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException:
de.sportscheck.SportScheckApplication
 at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
 at android.app.Instrumentation.newApplication(Instrumentation.java:948)
 at android.app.LoadedApk.makeApplication(LoadedApk.java:520)


Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Google Mapview

2012-04-11 Thread Ralph Bergmann | the4thFloor.eu
Am 11.04.12 10:30, schrieb Mini agrawal:
 Can you please explain in bit more details?
 
 On Wed, Apr 11, 2012 at 1:14 AM, Mark Murphy mmur...@commonsware.com
 mailto:mmur...@commonsware.com wrote:
 
 startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(geo:45,-110)));


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

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] AndroidHttpClient HttpGet with Basic Authorization

2012-04-01 Thread Ralph Bergmann | the4thFloor.eu
Hallo,


why I can't add a Authorization header field to my get request?

AndroidHttpClient client = AndroidHttpClient.newInstance(useragent);

HttpParams httpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParams, 15 * 1000);
HttpConnectionParams.setSoTimeout(httpParams, 15 * 1000);

HttpGet get = new HttpGet(url);
get.addHeader(Authorization, Base64 encoded String);
get.addHeader(Accept, application/json);
get.setParams(httpParams);

...


When I execute this request I get a HTTP/1.1 400 Bad Request response.

When I remove the line get.addHeader(Authorization, Base64 encoded
String); everything works fine (without the authorization).


What's going wrong? Is that the right way to do a basic authorization?
How to add the header field?



Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] AndroidHttpClient HttpGet with Basic Authorization

2012-04-01 Thread Ralph Bergmann | the4thFloor.eu
found an example

http://www.android-dev-faq.com/2011/11/how-to-make-httpdigest-client.html


Am 01.04.12 20:25, schrieb Ralph Bergmann | the4thFloor.eu:
 Hallo,
 
 
 why I can't add a Authorization header field to my get request?
 
 AndroidHttpClient client = AndroidHttpClient.newInstance(useragent);
 
 HttpParams httpParams = new BasicHttpParams();
 HttpConnectionParams.setConnectionTimeout(httpParams, 15 * 1000);
 HttpConnectionParams.setSoTimeout(httpParams, 15 * 1000);
 
 HttpGet get = new HttpGet(url);
 get.addHeader(Authorization, Base64 encoded String);
 get.addHeader(Accept, application/json);
 get.setParams(httpParams);
 
 ...
 
 
 When I execute this request I get a HTTP/1.1 400 Bad Request response.
 
 When I remove the line get.addHeader(Authorization, Base64 encoded
 String); everything works fine (without the authorization).
 
 
 What's going wrong? Is that the right way to do a basic authorization?
 How to add the header field?
 
 
 
 Ralph
 

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] date format problem

2012-03-30 Thread Ralph Bergmann | the4thFloor.eu
Am 30.03.12 09:05, schrieb Eyal Berman:
 i try to format a date from XML file the date is in the format  Thu, 15
 Mar 2012 00:00:00 +0200

try this:

/**
 * Thu, 04 Aug 2011 09:00:00 +0200
 */
protected static final SimpleDateFormat FORMATTER_StringToDate = new
SimpleDateFormat(E, dd   HH:mm:ss Z, Locale.ENGLISH);


Ralph

-- 

Ralph Bergmann

iOS and Android app developer


www  http://www.the4thFloor.eu | http://www.dasralph.de

mail ra...@the4thfloor.eu
skypedasralph

xing http://www.xing.com/profile/Ralph_Bergmann3
linkedin http://www.linkedin.com/in/ralphbergmann
gulp http://www.gulp.de/Profil/RalphBergmann.html

java user group  http://www.jug-bb.de | http://www.xing.com/net/jugbb
ios dev grouphttp://www.xing.com/net/iosberlin

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] XML Parsing w/ DocumentBuilder

2012-03-30 Thread Ralph Bergmann | the4thFloor.eu
I have not tried it but I think the 3rd child of the item element is
the title element. But you need the text child from this title element.


Ralph

-- 

Ralph Bergmann

iOS and Android app developer


www  http://www.the4thFloor.eu | http://www.dasralph.de

mail ra...@the4thfloor.eu
skypedasralph

xing http://www.xing.com/profile/Ralph_Bergmann3
linkedin http://www.linkedin.com/in/ralphbergmann
gulp http://www.gulp.de/Profil/RalphBergmann.html

java user group  http://www.jug-bb.de | http://www.xing.com/net/jugbb
ios dev grouphttp://www.xing.com/net/iosberlin

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Referring other library projects from within a library project.

2012-03-27 Thread Ralph Bergmann | the4thFloor.eu
Am 27.03.12 20:43, schrieb Y2i:
 It was working for me before R17 tools were available and works with R17
 tools too.

+1

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


Re: [android-developers] Re: Calendar edit event force close error....

2012-03-26 Thread Ralph Bergmann | the4thFloor.eu
A stack trace is this long error log which you have posted :-)

The error is a NullPointerException which means: the app try to access a
field which has no value. And the error appears here:
java.util.TimeZone.getTimeZone(TimeZone.java:286)

One possible solution:

public static final String  ALL_DAY
Is the event all day (time zone independent). Column name.

Try to set the right timezone.


Ralph


Am 26.03.12 09:56, schrieb Jast Vacaty:
 Well.I don't know what is stack trace.
 
 and I can't understand what this message mean...
 
 
 03-26 15:53:22.707: E/AndroidRuntime(2065): Caused by:
 java.lang.NullPointerException
 03-26 15:53:22.707: E/AndroidRuntime(2065): at
 java.util.TimeZone.getTimeZone(TimeZone.java:286)

-- 

Ralph Bergmann

iOS and Android app developer


www  http://www.the4thFloor.eu | http://www.dasralph.de

mail ra...@the4thfloor.eu
skypedasralph

xing http://www.xing.com/profile/Ralph_Bergmann3
gulp http://www.gulp.de/Profil/RalphBergmann.html
linkedin http://www.linkedin.com/in/ralphbergmann

java user group  http://www.jug-bb.de | http://www.xing.com/net/jugbb
ios dev grouphttp://www.xing.com/net/iosberlin


pgp key id   BED003DD883B9A80
pgp fingerprint  7865 EAD3 5834 705B D8B7 AD7C BED0 03DD 883B 9A80

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Multi-pane Layout

2012-03-26 Thread Ralph Bergmann | the4thFloor.eu
Hi,


I want to know: how to design a multi pane layout with more than 2 panes?

I found examples with 2 panes. But how to design the layout when I wont
more panes (with different widths)?

Example:

Main pane a and pane b are visible. The user clicks on an entry on pane
b. Pane a goes off to the left and from right comes pane c in. Just as
in the email app.



Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] facepreview20120218.apk does not install with adb

2012-03-18 Thread Ralph Bergmann | the4thFloor.eu
Am 18.03.12 10:57, schrieb karan hans:
 Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

Is it really so difficult to read, understand and/or to google the error
message?


http://stackoverflow.com/questions/3185444/how-to-deal-with-install-parse-failed-inconsistent-certificates-without-uninstal



Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] ListFragment fails on setContentView

2012-03-18 Thread Ralph Bergmann | the4thFloor.eu
Am 18.03.12 12:29, schrieb Jim Andresakis:
 and heres the layout were I call my fragment.
 
 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 
 

   
 ListFragment
 android:id=@+id/searchfrag
 android:layout_width=0dip
 android:layout_height=match_parent
 android:name=graffit.main.SearchListFrag
 android:layout_weight=1/ListFragment
 
 
 
 /LinearLayout
 java.lang.RuntimeException: Unable to start activity
 ComponentInfo{graffit.main/graffit.main.GraffSearch}:
 android.view.InflateException: Binary XML file line #9: Error inflating
 class ListFragment

ListFragment is not a subclass of View so it can't inflated.

You have to use ListView in your layout xml file.


http://android-developers.blogspot.de/2011/02/android-30-fragments-api.html

http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentListArraySupport.html



Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] facepreview20120218.apk does not install with adb

2012-03-17 Thread Ralph Bergmann | the4thFloor.eu
Am 17.03.12 16:41, schrieb karan hans:
 Failure [INSTALL_FAILED_ALREADY_EXISTS]
  ^^


Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] CalendarContract on Samsung's ICS update

2012-03-16 Thread Ralph Bergmann | the4thFloor.eu
Am 16.03.12 13:51, schrieb roee88:
 It works fine on Galaxy Nexus and other ICS devices and ROMs.
 On Samsung SGSII with their recent ICS update it simply doesn't do
 anything.

I think this happens because the SGS2 does not have the Google calendar
app. Samsung use their own calendar app which does not use this new
calendar api.

So you can use this api but you can't see the results because there is
no calendar which shows you the results.


Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Facebook integration

2012-03-12 Thread Ralph Bergmann | the4thFloor.eu
Am 12.03.12 11:55, schrieb Live Happy:
 i have integrate face book in my android  application but it there a way
 to get the online friends and also can i write a message to the inbox
 not to the wall of friends ?

is a little bit off-topic

http://qpleple.com/fetch-online-friends-list-with-facebook-graph-api/

https://developers.facebook.com/docs/reference/api/message/


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


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

2012-03-12 Thread Ralph Bergmann | the4thFloor.eu
Am 12.03.12 14:50, schrieb agung wiguna johan:
 Can somebody help me ?
 I don't have idea what filtering that i can use to clean noise from
 latitude and longitude

I had the same problem. I've filtered the data as follows.

1) max. accuracy
2) max. speed from one point to the next point
3) Kalman filter



Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Data written to SQLite database not immediately available

2011-12-23 Thread Ralph Bergmann | the4thFloor.eu
Am 23.12.11 00:06, schrieb lbendlin:
 it's not a bug, that's how SQLite works. You can't have concurrent
 writes. Not sure how the content provider buffers this but if you do
 plain SQLite you are basically blocking the database with each write,
 and you need to use semaphores to manage that.

I think a content provider can handle that.

I think you only have a timing problem. The content provider needs a
little bit to store the data.

You send a ping from one thread to the other thread. A better solution
is to register a content observer. With this observer the other thread
gets automatically a notification if the content provider has saved the
data.


Ralph


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] ListView scroll lag with images

2011-10-18 Thread Ralph Bergmann | the4thFloor.eu
Am 18.10.11 13:27, schrieb Sharief Shaik:
 thread. The problem is the ListView scroll is very laggy. What should
 we do to fix this problem?

try this:

http://www.vogella.de/articles/AndroidListView/article.html#listsactivity_performance

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


Re: [android-developers] How to display search button in actionbar on tablet (app minSdk = 8)

2011-10-09 Thread Ralph Bergmann | the4thFloor.eu
take a look at

http://developer.android.com/guide/topics/search/search-dialog.html#UsingSearchWidget

and

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/SearchViewActionBar.html


Am 09.10.11 22:58, schrieb Jean-Michel:
 Hi guys,
 I just (late and fairly stupidly) realised that one of the big
 differences of Honeycomb is the lack of always there standard
 buttons (home, back, search, menu).
 
 Home seems to be there all the time, as well as back (at least it is
 for my app).
 
 I found out how to get my menu back (target a SDK below 11), but I
 have been Googling for last 3 hours in order to discover how to get a
 search button in the action bar and I failed...
 
 So to make sure things are in perspective:
 - my app min SDK is 8;
 - I'd like to have the same code accross the board
 - I am using search to trigger a custom  action in a custom activity
 (still like a search, but not really a search).
 - furthermore I am using long press on serach as well.
 
 How can I have that on tablets whithout ruining the other users
 experience or write a specific  SDK 11+ version.
 
 Many thanks,
 JM
 

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] google map direction jar file

2011-10-05 Thread Ralph Bergmann | the4thFloor.eu
Am 05.10.11 07:45, schrieb Goutom:
 I want to get the direction from one GeoPoint to another GeoPoint.

[...]

 Any alternate solutions?

you can also use the webservice from google
http://code.google.com/intl/en/apis/maps/documentation/directions/

ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] ExtentedListView and Fragment.

2011-09-30 Thread Ralph Bergmann | the4thFloor.eu
Am 30.09.11 11:12, schrieb Akhilesh Mani:
 I want to develop a screen like this(attachment),with help
 of ExtentedListView and Fragment.
 Please suggest me.

take a look at the Honeycomb Gallery

http://developer.android.com/resources/samples/HoneycombGallery/index.html

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


Re: [android-developers] USB Host API on XOOM tablet

2011-09-29 Thread Ralph Bergmann | the4thFloor.eu
Am 23.09.11 16:27, schrieb Anil Sasidharan:
 It would be great to know if anyone has tested Android's USB Host API on
 any tablet device especially Motorola XOOM. I would really appreciate
 your comments/suggestions.

I tried the missile launcher app from the sample projects.

It does not work on my XOOM, but it works without any changes on my LG
Slate.

But it looks that it works on a XOOM, see
http://community.developer.motorola.com/t5/MOTODEV-Blog/Code-to-Launch-Foam-Missiles-Over-USB/ba-p/17889



Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] ProgressBar in ActionBar

2011-09-27 Thread Ralph Bergmann | the4thFloor.eu
Am 27.09.11 09:04, schrieb Isambert:
 I would like to implement something similar as what is present in
 Gmail's ActionBar on Honeycomb. I mean, when you click on the refresh

take a look at the google io app - http://code.google.com/p/iosched/

there is also a refresh button

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] plz help..!!!

2011-09-27 Thread Ralph Bergmann | the4thFloor.eu
Am 27.09.11 18:13, schrieb Divyata P:
 *how to solve error given below..!!!*

read the error message

 Are you missing a call to unregisterReceiver()?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] [Fragments/supportv4] How do I make ViewPager/TabHost attatch all tabs and not just the current and the one next to it?

2011-09-16 Thread Ralph Bergmann | the4thFloor.eu
Am 15.09.11 12:59, schrieb leson:
 How can I make the ViewPager/TabHost attach all tabs immediately?

I think you can't. You have to choose another holder for your tabs
views. I recommend the ViewAnimator.


see also:

http://code.google.com/p/openintents/source/browse/trunk/compatibility/AndroidSupportV2/src/android/support/v2/view/ViewPager.java
http://developer.android.com/reference/android/widget/ViewAnimator.html

-- 

Ralph Bergmann

iOS and Android app developer


www  http://www.the4thFloor.eu | http://www.dasralph.de

mail ra...@the4thfloor.eu
skypedasralph

xing http://www.xing.com/profile/Ralph_Bergmann3
gulp http://www.gulp.de/Profil/RalphBergmann.html
linkedin http://www.linkedin.com/in/ralphbergmann

java user group  http://www.jug-bb.de | http://www.xing.com/net/jugbb
ios dev grouphttp://www.xing.com/net/iosberlin


pgp key id   BED003DD883B9A80
pgp fingerprint  7865 EAD3 5834 705B D8B7 AD7C BED0 03DD 883B 9A80

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Out Of Memory Error with Images loaded through XML

2011-09-15 Thread Ralph Bergmann | the4thFloor.eu
Am 15.09.11 06:47, schrieb Sorab Pithawala:
 I have made a ZIP file containing the code, XML and a small readme.

Why do you do it that way:

h1 = BitmapFactory.decodeResource(res, R.drawable.help1_l);
ImageView im = (ImageView) findViewById(R.id.helpImage);
im.setImageBitmap(h1);

and not like this:

im.setImageDrawable(getResources().getDrawable(R.drawable.help1_l))


take also a look at:

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ImageSwitcher1.html

Ralph

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] JSON android

2011-09-05 Thread Ralph Bergmann | the4thFloor.eu
Am 02.09.11 16:10, schrieb ashish:
 How to check whether an element is a JSONArray or JSONObject. I wrote
 the code to check,

try this:

JSONObject jObject = new JSONObject();
JSONArray jArray = new JSONArray();

Object test = jObject;
if (test instanceof JSONObject) {
   Log.i(test, JSONObject);
} else if (test instanceof JSONArray) {
   Log.i(test, JSONArray);
}

test = jArray;
if (test instanceof JSONObject) {
   Log.i(test, JSONObject);
} else if (test instanceof JSONArray) {
   Log.i(test, JSONArray);
}



-- 

Ralph Bergmann

iOS and Android app developer


www  http://www.the4thFloor.eu | http://www.dasralph.de

mail ra...@the4thfloor.eu
skypedasralph

xing http://www.xing.com/profile/Ralph_Bergmann3
gulp http://www.gulp.de/Profil/RalphBergmann.html
linkedin http://www.linkedin.com/in/ralphbergmann

java user group  http://www.jug-bb.de | http://www.xing.com/net/jugbb
ios dev grouphttp://www.xing.com/net/iosberlin


pgp key id   BED003DD883B9A80
pgp fingerprint  7865 EAD3 5834 705B D8B7 AD7C BED0 03DD 883B 9A80

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