This repository has been archived by the owner on Jul 3, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dag Liodden
committed
Jul 19, 2012
1 parent
60c491f
commit 575c807
Showing
3 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
event-tracking/src/main/java/com/tapad/tracking/DeviceInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,18 @@ | |||
package com.tapad.tracking; | |||
|
|||
import android.content.Context; | |||
|
|||
public class DeviceInfo { | |||
|
|||
/** | |||
* Check if the screen configuration indicates that this is a tablet. | |||
*/ | |||
public static boolean isTablet(Context context) { | |||
return context.getResources().getConfiguration().screenLayout == 4; // SCREENLAYOUT_SIZE_XLARGE | |||
} | |||
|
|||
public static String getUserAgent(Context context) { | |||
if (isTablet(context)) return "Android Tablet/TapadEventAPI/1.0"; | |||
else return "Android Mobile/TapadEventAPI/1.0"; | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters