forked from hummatli/AppCrossPromoter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Installation Manual.txt
102 lines (86 loc) · 3.92 KB
/
Installation Manual.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Manual
1)Add MAHAds lib to project
2)Add following to your project somewere start or splash (on LancherActivity)
Code:
MAHAdsController.init(this, url_str);
MAHAdsController.setInternalCalled(getIntent().getBooleanExtra(MAHAdsController.MAH_ADS_INTERNAL_CALLED, false));
3)When you dont want open exit dialog on exit you call activity as below adn send argument
Intent app = pack.getLaunchIntentForPackage(pckgName);
app.putExtra(MAHAdsController.MAH_ADS_INTERNAL_CALLED, true);
getContext().startActivity(app);
MAHAdsController.setInternalCalled(getIntent().getBooleanExtra(MAHAdsController.MAH_ADS_INTERNAL_CALLED, false));
sets this value on initialization and checks on exit as below
4)Put following code to your start activity. (Because open exit dialog on exit)
Code:
public void onBackPressed() {
if(MAHAdsController.isInternalCalled()){
super.onBackPressed();
}else{
final FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); //get the fragment
final MAHAdsDlgExit frag = MAHAdsDlgExit.newInstance(this, new ExitListiner() {
@Override
public void onYes() {
finish();
}
@Override
public void onNo() {
// TODO Auto-generated method stub
}
});
frag.show(ft, "AdsDialogExit");
}
//super.onBackPressed();
}
5) Change color values for MAHAds for your project. And customize the values
<color name="mah_ads_title_bar_color">#FF0a23e1</color>
<color name="mah_ads_btn_open_install_text_color">#FF0a23e1</color>
<color name="mah_ads_text_color">#FF0a23e1</color>
<color name="mah_ads_no_img_color">#330a23e1</color>
<color name="mah_ads_question_txt_color">#FF0a23e1</color>
<color name="mah_ads_new_txt_background_color">#FFFFFFFF</color>
<color name="mah_ads_window_background_color">#FFFFFFFF</color>
<color name="mah_ads_dark_color">#FF0a23e1</color>
<color name="mah_ads_middle_color">#660a23e1</color>
<color name="mah_ads_light_color">#FFFFFFFF</color>
6) Add this to string.xml in main project8
<string name="mah_ads_close">Close</string>
<string name="mah_ads_dlg_title">Recommended applications</string>
<string name="mah_ads_text_google_play">Open in GooglePlay</string>
<string name="mah_ads_info_version">Version</string>
<string name="mah_ads_internet_update_error">Error, please check internet connection or link</string>
<string name="mah_ads_open_program">Open</string>
<string name="mah_ads_install_program">Install</string>
<string name="mah_ads_refresh_btn">Retry</string>
<string name="mah_ads_free_aps">Recommended applications</string>
<string name="mah_ads_new_text">New</string>
<string name="mah_ads_dlg_exit_question">Do you want exit?</string>
<string name="mah_ads_dlg_exit_positive_btn_txt">Exit</string>
<string name="mah_ads_dlg_exit_negativ_btn_txt">Stay</string>
<string name="mah_ads_dlg_exit_btn_more_txt_1">Applications</string>
<string name="mah_ads_dlg_exit_btn_more_txt_2">Detailed</string>
6) Add following permission to main project
<uses-permission android:name="android.permission.INTERNET" />
7)To show on menu on activity do following
a) add to menu.xml
<item
android:id="@+id/action_mahads"
android:orderInCategory="100"
android:title="@string/mah_ads_free_aps"
android:icon="@drawable/ic_action_more"
app:showAsAction="ifRoom"/>
b)on menu click methd write
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if(id == R.id.action_mahads){
final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
final MAHAdsDlgPrograms frag = MAHAdsDlgPrograms.newInstance(this);
frag.show(ft, "AdsDialogFragment");
return true;
}
return super.onOptionsItemSelected(item);
}
8) MAHAds use three lib
I) appcompat-v7
II)android-smart-image-view-1.0.0.jar
III)jsoup-1.7.3.jar