[android-developers] Re: Implementing Google map in application

2014-08-19 Thread Mark Turkel
This may have something to do with the Map API key.  I would re-generate 
that and use your key in a separate program that you know already works. If 
it fails, and the only thing you have changed is the key, then I would 
assume that's your problem.  If it works, then lets take a look at your 
code.

On Monday, August 18, 2014 9:08:32 AM UTC-4, dvalts wrote:

 Hello, i have tried few days to implement maps with API v2 in my 
 application.
 I have added every permission enabled every API, but don't have any 
 success.

 I'm stuck on this *Failed to load map. Error contacting Google servers. 
 This is probably an authentication issue (but could be due to network 
 errors).*, is there any way to find out what exactly went wrong, some 
 logs on API side in my account or anything that could help?
 I have regenerated my (debug) API key 4 times, does my API account has to 
 mach Google account that is registered with application?
 Another strange thing in logcat is this : Google Maps Android API(23503): 
 Google Play services client version: 4452000 and few lines later Google 
 Maps Android API(23503): Google Play services package version: 5089038
 Why two versions ?



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


[android-developers] Cross-platform development question

2013-06-21 Thread Mark Turkel
Hi all,

This is an interesting question, but a bit of background first...my company 
has been developing software for almost 30 years now.  We have always been 
a .net house, but now we're creating Android and iOS apps as well.  I don't 
want to have to write business logic and database access logic for each 
different platform, and since we're doing cloud apps, we should be able to 
call web services to get and put data into the database.

We have been using Entity Framework to communicate with SQL Server for our 
databases, and, as of late, we have been creating Single Page Applications 
using Breeze and Knockout.

We have created RESTful services using the WebAPI, but in working with 
Breeze, we like how it calls an IQueryable object.  My goal is to 
write-once, and be able to re-use for the mobile development.  

LINQ really makes things easier in that we don't have to have a specific 
API call for each entity, but I haven't found the right library, or I'm not 
using the right keywords for Google to search...I dunno, but all I'm 
finding are LINQ libraries that work on data already in memory.  That means 
I will have to bring LOTS of data to the mobile device just to work with 
it, and that's time-consuming and also will quickly eat up storage 
space...and why should I do that, when I have a powerful SQL Server that 
can get me only the data I need.

An example:

Just about every application starts out showing a list of reecords on a 
grid.  (It would require a query that returns an ID, and one or more 
descriptive fields (like first and last name).)  So we know we can create a 
RESTful API called getCustomers() and it would return the list for us to 
populate the grid.  Upon selection of an item, we would then want to make 
another call to the database to populate a detail screen.  We could create 
another RESTful API called getCustomer(id), for example, and it should 
return the fields that we need to populate the screen.

OR we could use the Entity Framework to create a Customers() object, and 
use LINQ to get what we want from it, just by modifying the calling 
URLwhich is easy, fun, and cool in the .net environment, and would 
satisfy my requirements of using the same business code for all platforms.

So here's the question:

How do you make a call to a RESTful service that returns an iQueryable 
object from Android (Java)?  Is there a Breeze-type of library for Android? 
 What is the best way to do this - create specific RESTful APIs, or is 
there a way to use this business layer we have already created that's 
living on the server?

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

2012-02-18 Thread Mark Turkel
Hi All,

I have an IIS service (.net) that I'm obviously not passing the
correct json message to.  I have tried many of the examples I have
found on the web, but they all seem to point to PHP services.  I'm
doing everything as everyone else is...and the json string looks as it
should.  Can someone please let me know the big secret? :)  This
should not take 2 days of my life to figure out... LOL!

Thank in advance for your help!
Mark Turkel
http://www.PalmBeachSoftware.com


Here's what I'm trying to post:

String baseurlString = http://MYSERVER.com/Service/SurfReport;;


   JSONObject json = new JSONObject();
try {
json.put(UserID, 
----0001);
json.put(City, Boynton Beach);
json.put(State, FL);
json.put(Country, USA);
json.put(Longitude, -80.06643);
json.put(Latitude, 26.525359);
json.put(RptDate, 02/17/2012);
json.put(WaveHeight, 3);
json.put(ConditionID, 1);
json.put(Comments, Go get wet!);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}





public void testPost(String baseurlString, final JSONObject json) {
try {


HttpParams httpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParams,
TIMEOUT_MILLISEC);
HttpConnectionParams.setSoTimeout(httpParams,
TIMEOUT_MILLISEC);
HttpClient client = new DefaultHttpClient(httpParams);

HttpPost request = new HttpPost(baseurlString);
request.addHeader(Content-Type, application/json;
charset=utf-8);

request.setEntity(new
ByteArrayEntity(json.toString().getBytes(UTF8)));
request.setHeader(json, json.toString());

HttpResponse response = client.execute(request);
HttpEntity entity = response.getEntity();

// If the response does not enclose an entity, there
is no need
if (entity != null) {
InputStream instream = entity.getContent();

String result =
RestClient.convertStreamToString(instream);
Log.i(MARK,RESULT from server:  + result);
Log.i(MARK, sending surf report to: + baseurlString +
:   + request.getRequestLine()  + json.toString());

}
} catch (Throwable t) {
Toast.makeText(this, Request failed:  + t.toString(),
Toast.LENGTH_LONG).show();
}
}

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


[android-developers] Re: sound player

2012-02-18 Thread Mark Turkel
Here's code that I am using repeatedly in several apps... hope this
helps!  :)

final class PlaySound {
public static boolean playing=false;

private static HashSetMediaPlayer mpSet = new
HashSetMediaPlayer();

static void play(Context context, int resId) {
playing=true;
MediaPlayer mp = MediaPlayer.create(context, resId);
mp.setOnCompletionListener(new
MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
mpSet.remove(mp);
mp.stop();
mp.release();
playing=false;
}
});
mpSet.add(mp);
mp.start();
}

static void stop() {
for (MediaPlayer mp : mpSet) {
if (mp != null) {
mp.stop();
mp.release();
playing=false;
}
}
mpSet.clear();
}
}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Relative Layout, buttons are being hidden behind image on orientation change

2012-01-20 Thread Mark Turkel
Hi, 

I'm having an issue with screen sizes and compatibility.  I wrote an app 
for a tablet, and now trying to convert it to run on phones as well.  All 
is fine, going to the 2.2 minimum platform, but when I go from landscape to 
portrait mode, or even just start in portrait mode, I can't see the two 
buttons on the screen.
The top 2/3 of the layout is an imageview control, set to 
AdjustViewBounds=true, and ScaleType= fitCenter, LayoutAlignParentTop=true, 
height, width= Wrap content.

In the landscape mode XML, I have the buttons on the left and right of the 
imageview and it works great, in portrait mode, I want the picture to take 
up the width of the screen and have the buttons below, which LOOK PERFECT 
in the Graphical Layout mode in eclipse. In the emulator, I don't see them. 
 It is a 2.2AVD as well.

Any help is greatly appreciated  :)

Thanks,
Mark Turkel
Palm Beach Software Design, Inc.
m...@palmbeachsoftware.com
561-572-0233

Here's the XML:

?xml version=1.0 encoding=utf-8?

RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android;

android:id=@+id/relLayout

android:layout_width=fill_parent

android:layout_height=fill_parent

android:background=@color/white 


TextView

android:id=@+id/textPageNumber

android:layout_width=wrap_content

android:layout_height=wrap_content

android:layout_alignParentBottom=true

android:layout_alignParentLeft=true

android:gravity=left

android:paddingLeft=10dip

android:text=Page 1 of ##

android:textSize=20dip

android:textStyle=bold /


ImageView

android:id=@+id/imageView1

android:layout_width=wrap_content

android:layout_height=wrap_content

android:layout_alignParentTop=true

android:adjustViewBounds=true

android:scaleType=fitCenter

android:scrollbarAlwaysDrawVerticalTrack=true

android:src=@drawable/cover /


ToggleButton

android:id=@+id/toggleButtonSpeak

android:layout_width=wrap_content

android:layout_height=wrap_content

android:layout_alignParentBottom=true

android:layout_alignParentRight=true

android:checked=true

android:text=Speech On

android:textColor=@color/black

android:textOff=Speech Off

android:textOn=Speech On /


ImageButton

android:id=@+id/imageButtonNext

android:layout_width=wrap_content

android:layout_height=wrap_content

android:layout_above=@+id/toggleButtonSpeak

android:layout_alignParentRight=true

android:src=@drawable/paw_next /


ImageButton

android:id=@+id/imageButtonPrevious

android:layout_width=wrap_content

android:layout_height=wrap_content

android:layout_above=@+id/toggleButtonSpeak

android:layout_alignParentLeft=true

android:src=@drawable/paw_previous

android:visibility=visible /


/RelativeLayout

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