Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_goodmoney
Commits
9557d6d2
Commit
9557d6d2
authored
Apr 13, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
6cd1ff82
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
41 deletions
+43
-41
ReadToutiaoAD.java
.../main/java/com/mints/goodmoney/manager/ReadToutiaoAD.java
+1
-1
ReadYlhAd.java
.../src/main/java/com/mints/goodmoney/manager/ReadYlhAd.java
+1
-1
TtCsjAdManager.java
...main/java/com/mints/goodmoney/manager/TtCsjAdManager.java
+1
-0
YlhAdManager.kt
...src/main/java/com/mints/goodmoney/manager/YlhAdManager.kt
+1
-0
PhoneParameterUtils.java
...ain/java/com/mints/library/utils/PhoneParameterUtils.java
+39
-39
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/ReadToutiaoAD.java
View file @
9557d6d2
...
...
@@ -55,7 +55,7 @@ public class ReadToutiaoAD {
private
void
initFeedAD
(
OnAdViewReceiver
receiver
,
int
width
,
int
height
,
OnClickListener
clickListener
)
{
//设置广告参数
AdSlot
adSlot
=
new
AdSlot
.
Builder
()
.
setCodeId
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_
AWAR
D
)
//广告位id
.
setCodeId
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_
REA
D
)
//广告位id
.
setSupportDeepLink
(
true
)
.
setAdCount
(
1
)
//请求广告数量为1到3条
.
setExpressViewAcceptedSize
(
width
,
height
)
//必填:期望个性化模板广告view的size,单位dp
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/ReadYlhAd.java
View file @
9557d6d2
...
...
@@ -29,7 +29,7 @@ public class ReadYlhAd {
}
private
void
initVedioAD
(
final
Context
context
,
OnAdViewReceiver
receiver
)
{
rewardVideoAD
=
new
RewardVideoAD
(
context
,
YlhAdManager
.
INSTANCE
.
getYLH_AD_VEDIO_
DRINK
_POSTID
(),
new
RewardVideoADListener
()
{
rewardVideoAD
=
new
RewardVideoAD
(
context
,
YlhAdManager
.
INSTANCE
.
getYLH_AD_VEDIO_
READER
_POSTID
(),
new
RewardVideoADListener
()
{
@Override
public
void
onADLoad
()
{
//广告加载成功,可在此回调后进行广告展示,此时广告过期时间确定,可通过RewardVideoAD.getExpireTimestamp()获取
receiver
.
onReceive
(
true
,
null
);
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/TtCsjAdManager.java
View file @
9557d6d2
...
...
@@ -47,6 +47,7 @@ public class TtCsjAdManager {
/*全屏视频*/
public
static
String
TT_AD_FULLVEDIO_ALL
=
"945752969"
;
// 通用
/*信息流*/
public
static
String
TT_AD_NATIVEEXPRESS_READ
=
"946010585"
;
//听读
public
static
String
TT_AD_NATIVEEXPRESS_XMLY
=
"945700753"
;
//喜马拉雅信息流
public
static
String
TT_AD_NATIVEEXPRESS_AWARD
=
"945562047"
;
//信息流弹窗
public
static
String
TT_AD_NATIVEEXPRESS_WALK
=
"945562698"
;
//走路
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/YlhAdManager.kt
View file @
9557d6d2
...
...
@@ -29,6 +29,7 @@ object YlhAdManager {
var
YLH_AD_VEDIO_MOREDIALOG_POSTID
=
"9001346780383626"
//气泡
var
YLH_AD_VEDIO_SIGN_POSTID
=
"9001346780383626"
//签到
var
YLH_AD_VEDIO_OFFINELINE_POSTID
=
"9001346780383626"
//离线弹框
var
YLH_AD_VEDIO_READER_POSTID
=
"7051178727922752"
//听读
var
YLH_AD_VEDIO_GAME_POSTID
=
"9051646750686770"
//猎豹游戏
var
YLH_AD_VEDIO_JULEYUN_POSTID
=
"1011746770898338"
//聚乐云
...
...
GoodMoney/app/src/main/java/com/mints/library/utils/PhoneParameterUtils.java
View file @
9557d6d2
...
...
@@ -16,44 +16,44 @@ import java.net.URLEncoder;
*/
public
class
PhoneParameterUtils
{
/**
* 获取MAC地址
*
* @return
*/
public
static
String
getMacAddress
(
Application
application
)
{
WifiManager
manager
=
(
WifiManager
)
application
.
getSystemService
(
Context
.
WIFI_SERVICE
);
String
MacAddress
=
""
;
if
(
manager
!=
null
)
{
MacAddress
=
manager
.
getConnectionInfo
().
getMacAddress
();
}
return
MacAddress
;
}
/**
* 返回用户手机运营商名称 * @param telephonyManager * @return
*/
public
static
String
getProvidersName
(
Application
loanApplication
)
{
String
ProvidersName
=
null
;
try
{
TelephonyManager
telephonyManager
=
(
TelephonyManager
)
loanApplication
.
getSystemService
(
Context
.
TELEPHONY_SERVICE
);
String
IMSI
;
// 返回唯一的用户ID;就是这张卡的编号神马的
IMSI
=
telephonyManager
.
getSubscriberId
();
if
(
IMSI
==
null
)
return
"unkwon"
;
// IMSI号前面3位460是国家,紧接着后面2位00 02是中国移动,01是中国联通,03是中国电信。其中
if
(
IMSI
.
startsWith
(
"46000"
)
||
IMSI
.
startsWith
(
"46002"
))
{
ProvidersName
=
"中国移动"
;
}
else
if
(
IMSI
.
startsWith
(
"46001"
))
{
ProvidersName
=
"中国联通"
;
}
else
if
(
IMSI
.
startsWith
(
"46003"
))
{
ProvidersName
=
"中国电信"
;
}
ProvidersName
=
URLEncoder
.
encode
(
""
+
ProvidersName
,
"UTF-8"
);
}
catch
(
UnsupportedEncodingException
e
)
{
// TODO Auto-generated catch block e.printStackTrace();
}
return
ProvidersName
;
}
//
/**
//
* 获取MAC地址
//
*
//
* @return
//
*/
//
public static String getMacAddress(Application application) {
//
WifiManager manager = (WifiManager) application.getSystemService(Context.WIFI_SERVICE);
//
String MacAddress = "";
//
if (manager != null) {
//
MacAddress = manager.getConnectionInfo().getMacAddress();
//
}
//
return MacAddress;
//
}
//
//
/**
//
* 返回用户手机运营商名称 * @param telephonyManager * @return
//
*/
//
public static String getProvidersName(Application loanApplication) {
//
String ProvidersName = null;
//
try {
//
TelephonyManager telephonyManager = (TelephonyManager) loanApplication.getSystemService(Context.TELEPHONY_SERVICE);
//
String IMSI; // 返回唯一的用户ID;就是这张卡的编号神马的
//
IMSI = telephonyManager.getSubscriberId();
//
if (IMSI == null)
//
return "unkwon";
//
// IMSI号前面3位460是国家,紧接着后面2位00 02是中国移动,01是中国联通,03是中国电信。其中
//
if (IMSI.startsWith("46000") || IMSI.startsWith("46002")) {
//
ProvidersName = "中国移动";
//
} else if (IMSI.startsWith("46001")) {
//
ProvidersName = "中国联通";
//
} else if (IMSI.startsWith("46003")) {
//
ProvidersName = "中国电信";
//
}
//
ProvidersName = URLEncoder.encode("" + ProvidersName, "UTF-8");
//
} catch (UnsupportedEncodingException e) {
//
// TODO Auto-generated catch block e.printStackTrace();
//
}
//
return ProvidersName;
//
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment